pub struct InstallShutdownPlan<P> { /* private fields */ }Expand description
Install one validated plan into a coordinator that was started without it.
The plan type is part of the coordinator’s event sum. Homogeneous and heterogeneous plans therefore cannot be confused at installation:
ⓘ
struct Probe;
impl behavior::Protocol for Probe { type Addr = behavior::MailAddr; type Msg = (); }
impl behavior::Behavior for Probe {
type Protocol = Self;
type Event = behavior::User<behavior::MailAddr, ()>;
type Sends = Vec<behavior::Never>;
type Ph = behavior::Never;
type Error = behavior::Never;
type Birth = behavior::NoBirths;
fn transition(&mut self, _: behavior::ActiveTurn, _: Self::Event) -> behavior::BehaviorActed<Self> {
Ok(behavior::Actions::cont())
}
}
type Targets = behavior_actors::ShutdownChoice<behavior_actors::StopOnShutdown<Probe>, behavior_actors::NoShutdownTargets<behavior::MailAddr>>;
let mut coordinator = behavior_actors::Activate::initialize(
behavior_actors::ShutdownCoordinator::<Probe, behavior_actors::StopOnShutdown<Probe>, behavior::ChildHead>::awaiting_plan(Probe)
).unwrap().behavior;
let heterogeneous = behavior_actors::HeterogeneousShutdownPlan::<Targets>::new([]).unwrap();
coordinator.on_path(behavior_actors::InstallShutdownPlan::new(heterogeneous)).unwrap();Implementations§
Trait Implementations§
Source§impl<E: UserEvent, P> EventIngress<Here, InstallShutdownPlan<P>> for ShutdownCoordinatorEvent<E, P>
impl<E: UserEvent, P> EventIngress<Here, InstallShutdownPlan<P>> for ShutdownCoordinatorEvent<E, P>
Source§fn ingress(value: InstallShutdownPlan<P>) -> Self
fn ingress(value: InstallShutdownPlan<P>) -> Self
Construct the event selected for
Source and Input.Source§impl<E: UserEvent, P> InjectEvent<InstallShutdownPlan<P>, Here> for ShutdownCoordinatorEvent<E, P>
impl<E: UserEvent, P> InjectEvent<InstallShutdownPlan<P>, Here> for ShutdownCoordinatorEvent<E, P>
fn inject_at(value: InstallShutdownPlan<P>) -> Self
Auto Trait Implementations§
impl<P> Freeze for InstallShutdownPlan<P>where
P: Freeze,
impl<P> RefUnwindSafe for InstallShutdownPlan<P>where
P: RefUnwindSafe,
impl<P> Send for InstallShutdownPlan<P>where
P: Send,
impl<P> Sync for InstallShutdownPlan<P>where
P: Sync,
impl<P> Unpin for InstallShutdownPlan<P>where
P: Unpin,
impl<P> UnsafeUnpin for InstallShutdownPlan<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for InstallShutdownPlan<P>where
P: 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