pub struct Compose<B> { /* private fields */ }Implementations§
Source§impl<S, A, M, Sends, Br, E, I, F> Compose<BehaviorFn<S, A, M, Sends, Br, E, I, F>>
impl<S, A, M, Sends, Br, E, I, F> Compose<BehaviorFn<S, A, M, Sends, Br, E, I, F>>
Source§impl<B: Behavior> Compose<B>
impl<B: Behavior> Compose<B>
pub fn from_behavior(behavior: B) -> Self
pub fn build(self) -> B
pub fn behavior(&self) -> &B
Sourcepub fn stop_on_shutdown(self) -> Compose<StopOnShutdown<B>>
pub fn stop_on_shutdown(self) -> Compose<StopOnShutdown<B>>
Stop normally when a typed shutdown request is folded.
Sourcepub fn finalize_on_shutdown(
self,
finalize: ShutdownReaction<B>,
) -> Compose<FinalizeOnShutdown<B>>
pub fn finalize_on_shutdown( self, finalize: ShutdownReaction<B>, ) -> Compose<FinalizeOnShutdown<B>>
Apply one final pure fold, retain its sends and creations, and stop normally regardless of the fold’s become verdict.
Sourcepub fn watch(
self,
peer: B::Addr,
on_stopped: LinkReaction<B>,
) -> Compose<Watch<B>>
pub fn watch( self, peer: B::Addr, on_stopped: LinkReaction<B>, ) -> Compose<Watch<B>>
Observe a peer and apply a pure reaction when it stops.
Sourcepub fn deadline(
self,
when: Option<Instant>,
on_reached: DeadlineReaction<B>,
) -> Compose<Deadline<B>>
pub fn deadline( self, when: Option<Instant>, on_reached: DeadlineReaction<B>, ) -> Compose<Deadline<B>>
Apply a pure reaction when the given absolute time is reached.
§Panics
Panics if one specification composes more than u64::MAX timer
capabilities.
Sourcepub fn receive_timeout(
self,
after: Duration,
on_elapsed: ReceiveTimeoutReaction<B>,
) -> Compose<ReceiveTimeout<B>>
pub fn receive_timeout( self, after: Duration, on_elapsed: ReceiveTimeoutReaction<B>, ) -> Compose<ReceiveTimeout<B>>
Notify the behavior once after an idle period containing no successful user communication.
Initialization and each successful continuing user fold emit a relative
schedule. Service events never reset inactivity. A matching delivery is
consumed before on_elapsed runs, and a continuing reaction remains
unarmed until another successful continuing user communication.
§Panics
Panics if one specification composes more than u64::MAX timer
capabilities.
Sourcepub fn stash(self, route: fn(&B::Msg) -> StashRoute) -> Compose<Stash<B>>
pub fn stash(self, route: fn(&B::Msg) -> StashRoute) -> Compose<Stash<B>>
Hold messages selected by route and replay them on Release.
Sourcepub fn children<C>(
self,
fleet: (usize, fn(usize) -> C),
) -> Compose<Supervisor<B, C>>
pub fn children<C>( self, fleet: (usize, fn(usize) -> C), ) -> Compose<Supervisor<B, C>>
Create a supervised child topology. Concrete proxy and monitor types remain hidden in the returned typestate.
pub fn children_with_nonces<C>( self, nonces: fn(usize) -> <B::Addr as Address>::Nonce, count: usize, build: fn(usize) -> C, ) -> Compose<Supervisor<B, C>>
Source§impl<B, C> Compose<Supervisor<B, C>>
impl<B, C> Compose<Supervisor<B, C>>
pub fn restart(self, strategy: Strategy) -> Self
pub fn when(self, policy: RestartPolicy) -> Self
pub fn within(self, maximum: u32, window: Duration) -> Self
Sourcepub fn on_supervision_failure(
self,
reaction: SupervisionFailureReaction<B>,
) -> Self
pub fn on_supervision_failure( self, reaction: SupervisionFailureReaction<B>, ) -> Self
Apply a pure reaction when supervision can no longer preserve its child topology.