pub struct SimulationContext { /* private fields */ }Expand description
Clean API exposed to simulation authors.
Implementations§
Source§impl SimulationContext
impl SimulationContext
pub fn from_raw(raw: SimContext) -> Self
pub fn log(&self, level: SimLogLevel, message: impl AsRef<str>)
pub fn info(&self, message: impl AsRef<str>)
pub fn set_output_bytes(&self, name: impl AsRef<str>, payload: &[u8])
pub fn set_output_f32(&self, name: impl AsRef<str>, value: f32)
pub fn get_input_bytes( &self, name: impl AsRef<str>, out: &mut [u8], ) -> Option<usize>
pub fn get_input_f32(&self, name: impl AsRef<str>) -> Option<f32>
pub fn set_state(&self, state: impl AsRef<str>)
Trait Implementations§
Source§impl Clone for SimulationContext
impl Clone for SimulationContext
Source§fn clone(&self) -> SimulationContext
fn clone(&self) -> SimulationContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SimulationContext
Auto Trait Implementations§
impl !Send for SimulationContext
impl !Sync for SimulationContext
impl Freeze for SimulationContext
impl RefUnwindSafe for SimulationContext
impl Unpin for SimulationContext
impl UnsafeUnpin for SimulationContext
impl UnwindSafe for SimulationContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more