pub struct SimNetHandle { /* private fields */ }
Expand description
A handle to a running SimNet
instance.
Implementations§
Source§impl SimNetHandle
impl SimNetHandle
Sourcepub fn send_event(&self, event: Box<dyn Event>) -> Result<(), SimNetError>
pub fn send_event(&self, event: Box<dyn Event>) -> Result<(), SimNetError>
Sends an event to be scheduled onto the simnet’s event loop
Sourcepub fn send_nonadvanceable_event(
&self,
event: Box<dyn Event>,
) -> Result<(), SimNetError>
pub fn send_nonadvanceable_event( &self, event: Box<dyn Event>, ) -> Result<(), SimNetError>
Sends an non-advanceable event to be scheduled onto the simnet’s event loop A non-advanceable event is an event that cannot advance the simnet’s time unless the earliest event in the simnet’s advancing event queue occurs after the earliest event in the simnet’s non-advancing event queue, or some debounce period has passed where there are only events in the simnet’s non-advancing event queue.
Sourcepub fn set_training_script_state(&self, state: TrainingScriptState)
pub fn set_training_script_state(&self, state: TrainingScriptState)
Let the simnet know if the training script is running or waiting for the backend to return a future result.
Sourcepub fn bind(&self, address: ChannelAddr) -> Result<(), SimNetError>
pub fn bind(&self, address: ChannelAddr) -> Result<(), SimNetError>
Bind the given address to this simulator instance.
Sourcepub async fn close(&self) -> Result<Vec<SimulatorEventRecord>, JoinError>
pub async fn close(&self) -> Result<Vec<SimulatorEventRecord>, JoinError>
Close the simulator, processing pending messages before completing the returned future.
Sourcepub async fn flush(&self, timeout: Duration) -> Result<(), SimNetError>
pub async fn flush(&self, timeout: Duration) -> Result<(), SimNetError>
Wait for all of the received events to be scheduled for flight. It ticks the simnet time till all of the scheduled events are processed.
Sourcepub fn register_proc(&self, proc_id: ProcId, point: Point)
pub fn register_proc(&self, proc_id: ProcId, point: Point)
Register the location in resource space for a Proc
Sourcepub fn sample_latency(&self, src: &ProcId, dest: &ProcId) -> Duration
pub fn sample_latency(&self, src: &ProcId, dest: &ProcId) -> Duration
Sample a latency between two procs
Auto Trait Implementations§
impl !Freeze for SimNetHandle
impl !RefUnwindSafe for SimNetHandle
impl Send for SimNetHandle
impl Sync for SimNetHandle
impl Unpin for SimNetHandle
impl !UnwindSafe for SimNetHandle
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more