pub struct Spec<B> { /* private fields */ }Implementations§
Source§impl<B: Behavior> Spec<B>
impl<B: Behavior> Spec<B>
pub fn from_behavior(behavior: B) -> Self
pub fn build(self) -> B
pub fn behavior(&self) -> &B
Sourcepub fn stop_on_shutdown(self) -> Spec<StopOnShutdown<B>>
pub fn stop_on_shutdown(self) -> Spec<StopOnShutdown<B>>
Stop normally when a typed shutdown request is folded.
Sourcepub fn finalize_on_shutdown(
self,
finalize: ShutdownReaction<B>,
) -> Spec<FinalizeOnShutdown<B>>
pub fn finalize_on_shutdown( self, finalize: ShutdownReaction<B>, ) -> Spec<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>,
) -> Spec<Watching<B>>
pub fn watch( self, peer: B::Addr, on_stopped: LinkReaction<B>, ) -> Spec<Watching<B>>
Observe a peer and apply a pure reaction when it stops.
Sourcepub fn at(self, when: Option<Instant>, on_reached: AtReaction<B>) -> Spec<At<B>>
pub fn at(self, when: Option<Instant>, on_reached: AtReaction<B>) -> Spec<At<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 stash(self, route: fn(&B::Msg) -> StashRoute) -> Spec<Stashing<B>>
pub fn stash(self, route: fn(&B::Msg) -> StashRoute) -> Spec<Stashing<B>>
Hold messages selected by route and replay them on Release.
Sourcepub fn children<C>(
self,
fleet: (usize, fn(usize) -> C),
) -> Spec<Supervising<B, C>>
pub fn children<C>( self, fleet: (usize, fn(usize) -> C), ) -> Spec<Supervising<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, ) -> Spec<Supervising<B, C>>
Trait Implementations§
Source§impl<B, A, Ph, Sends, Br> Behavior for Spec<B>
impl<B, A, Ph, Sends, Br> Behavior for Spec<B>
type Addr = A
type Msg = <B as Behavior>::Msg
type Event = <B as Behavior>::Event
type Sends = Sends
type Ph = Ph
type Error = <B as Behavior>::Error
type Birth = Br
type Effect = <B as Behavior>::Effect
type Done = <B as Behavior>::Done
async fn init(&mut self) -> Result<Self::Effect, B::Error>
async fn step(&mut self, event: B::Event) -> Result<Self::Effect, B::Error>
Auto Trait Implementations§
impl<B> Freeze for Spec<B>where
B: Freeze,
impl<B> RefUnwindSafe for Spec<B>where
B: RefUnwindSafe,
impl<B> Send for Spec<B>where
B: Send,
impl<B> Sync for Spec<B>where
B: Sync,
impl<B> Unpin for Spec<B>where
B: Unpin,
impl<B> UnsafeUnpin for Spec<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for Spec<B>where
B: UnwindSafe,
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