Skip to main content

InstallShutdownPlan

Struct InstallShutdownPlan 

Source
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§

Source§

impl<P> InstallShutdownPlan<P>

Source

pub const fn new(plan: P) -> Self

Construct the explicit plan-installation input.

Source

pub fn into_plan(self) -> P

Consume the input into the validated plan it owns.

Trait Implementations§

Source§

impl<E: UserEvent, P> EventIngress<Here, InstallShutdownPlan<P>> for ShutdownCoordinatorEvent<E, P>

Source§

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>

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.