pub struct SharedHook<E, M: Model<E>, H: Hook<E, M>> { /* private fields */ }Expand description
A wrapper that allows a hook to be shared across multiple components via Arc.
Implementations§
Trait Implementations§
Source§fn before_simulation(&self, model: &M)
fn before_simulation(&self, model: &M)
Invoked immediately before the simulation starts.
Source§fn after_simulation(&self, model: &M, end_tick: SimTime)
fn after_simulation(&self, model: &M, end_tick: SimTime)
Invoked immediately after the simulation finishes.
Source§fn before_tick(
&self,
model: &M,
current_tick: SimTime,
skipped_duration: Duration,
)
fn before_tick( &self, model: &M, current_tick: SimTime, skipped_duration: Duration, )
Invoked at the beginning of a tick process. Read more
Source§fn after_tick(
&self,
model: &M,
current_tick: SimTime,
last_micro_step: MicroStep,
)
fn after_tick( &self, model: &M, current_tick: SimTime, last_micro_step: MicroStep, )
Invoked immediately after a tick process has completed.
Source§fn before_micro_step(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
)
fn before_micro_step( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, )
Invoked at the beginning of a micro-step.
Source§fn after_micro_step(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
)
fn after_micro_step( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, )
Invoked at the end of a micro-step.
Source§fn on_discard_remain_micro_step(
&self,
model: &M,
current_tick: SimTime,
first_discarded_micro_step: MicroStep,
discarded_sources: &[SourceReadyEntry],
discarded_events: &[Event<E>],
)
fn on_discard_remain_micro_step( &self, model: &M, current_tick: SimTime, first_discarded_micro_step: MicroStep, discarded_sources: &[SourceReadyEntry], discarded_events: &[Event<E>], )
Invoked when remaining tasks (events or sources) are discarded due to execution limits.
Source§fn before_register_source(&self, model: &M, name: &str)
fn before_register_source(&self, model: &M, name: &str)
Invoked when a source registration begins.
Source§fn after_register_source(&self, model: &M, name: &str)
fn after_register_source(&self, model: &M, name: &str)
Invoked when a source registration completes.
Source§fn before_source_phase(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
)
fn before_source_phase( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, )
Invoked at the beginning of the source processing phase.
Source§fn before_source(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
source_view: &SourceView,
)
fn before_source( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, source_view: &SourceView, )
Invoked immediately before an individual source fires.
Source§fn after_source(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
source_view: &SourceView,
computed_next_fire: Option<SimTime>,
)
fn after_source( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, source_view: &SourceView, computed_next_fire: Option<SimTime>, )
Invoked immediately after an individual source fires.
Source§fn cancel_source(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
scheduled_at: SimTime,
source_view: &SourceView,
)
fn cancel_source( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, scheduled_at: SimTime, source_view: &SourceView, )
Invoked when a scheduled source is canceled.
Source§fn discard_source(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
source_view: &SourceView,
)
fn discard_source( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, source_view: &SourceView, )
Invoked when a source is explicitly discarded.
Source§fn after_source_phase(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
)
fn after_source_phase( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, )
Invoked at the end of the source processing phase.
Source§fn before_event_phase(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
)
fn before_event_phase( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, )
Invoked at the beginning of the event processing phase.
Source§fn before_event(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
event: &Event<E>,
)
fn before_event( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, event: &Event<E>, )
Invoked immediately before an event is processed.
Source§fn after_event(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
event: &Event<E>,
)
fn after_event( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, event: &Event<E>, )
Invoked immediately after an event is processed.
Source§fn cancel_event(
&self,
model: &M,
current_tick: SimTime,
current_micro_step: MicroStep,
scheduled_at: SimTime,
event: &Event<E>,
)
fn cancel_event( &self, model: &M, current_tick: SimTime, current_micro_step: MicroStep, scheduled_at: SimTime, event: &Event<E>, )
Invoked when a scheduled event is canceled.
Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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