Skip to main content

ChildCreationOutcome

Enum ChildCreationOutcome 

Source
pub enum ChildCreationOutcome<C, Occurrence>{
    Established(CommittedChild<C, Occurrence>),
    InitializationRejected {
        creation: RoutedCreation<BehaviorAddr<C>, C>,
        error: C::Error,
    },
    InitializationPanicked {
        creation: RoutedCreation<BehaviorAddr<C>, C>,
    },
    HostRejected {
        creation: RoutedCreation<BehaviorAddr<C>, C>,
        initialization: Actions<BehaviorAddr<C>, C::Ph, C::Sends, C::Birth>,
        reason: CreationRejection,
    },
}
Expand description

Complete result after a runtime accepts one child definition.

A created child leaves only its exact established capability. Rejection during the pure initialization transition returns the current child and its exact error. A caught panic returns the extant current child without claiming an error or successful actions. Rejection while establishing the host returns the current child and the still-uninterpreted initialization actions. No variant reconstructs a pre-initialization value or silently discards an affine action.

A failed child installation returns current work and no installed actor:

ⓘ
fn rejected_actor<C, Occurrence>(outcome: behavior::ChildCreationOutcome<C, Occurrence>)
where
    C: behavior::Behavior,
    behavior::BehaviorAddr<C>: behavior::EndpointAddress,
{
    if let behavior::ChildCreationOutcome::HostRejected { actor, .. } = outcome {
        let _: behavior::EstablishedActor<C> = actor;
    }
}

Variants§

§

Established(CommittedChild<C, Occurrence>)

Fresh child creation committed successfully.

§

InitializationRejected

The child’s pure initialization transition rejected before host commit.

Fields

§creation: RoutedCreation<BehaviorAddr<C>, C>

Current child value with its creator correlation and private route.

§error: C::Error

Exact error returned by the child’s initialization transition.

§

InitializationPanicked

The child’s pure initialization panicked before any host commitment.

Only the outer routed child that survived Rust unwinding is returned; this does not promise recovery of values destroyed inside user code.

Fields

§creation: RoutedCreation<BehaviorAddr<C>, C>

Current child value with its creator correlation and private route.

§

HostRejected

Host establishment rejected after initialization produced actions.

Fields

§creation: RoutedCreation<BehaviorAddr<C>, C>

Current child value with its creator correlation and private route.

§initialization: Actions<BehaviorAddr<C>, C::Ph, C::Sends, C::Birth>

Complete initialization actions that were never interpreted.

§reason: CreationRejection

Exact reason the host could not commit this child.

Implementations§

Source§

impl<C, Occurrence> ChildCreationOutcome<C, Occurrence>

Source

pub fn into_committed(self) -> Result<CommittedChild<C, Occurrence>, Self>

Consume a committed child result into its exact concrete actor capability.

The committed variant directly owns the actor, ID, kind, and occurrence; no nested rejection can appear under success.

§Errors

Returns the complete original result when creation did not commit.

Source

pub fn into_actor(self) -> Result<EstablishedActor<C>, Self>

Consume a committed child into its exact actor.

§Errors

Returns the complete original result when creation did not commit.

Auto Trait Implementations§

§

impl<C, Occurrence> Freeze for ChildCreationOutcome<C, Occurrence>

§

impl<C, Occurrence> RefUnwindSafe for ChildCreationOutcome<C, Occurrence>

§

impl<C, Occurrence> Send for ChildCreationOutcome<C, Occurrence>
where <<C as Behavior>::Protocol as Protocol>::Addr: Sized, <C as Behavior>::Error: Send, <<<C as Behavior>::Protocol as Protocol>::Addr as Address>::Nonce: Send, <C as Behavior>::Sends: Send, <<<C as Behavior>::Protocol as Protocol>::Addr as EndpointAddress>::Installed<C>: Send, C: Send, <C as Behavior>::Ph: Send, <<C as Behavior>::Birth as BirthMode>::Child: Send,

§

impl<C, Occurrence> Sync for ChildCreationOutcome<C, Occurrence>
where <<C as Behavior>::Protocol as Protocol>::Addr: Sized, <C as Behavior>::Error: Sync, <<<C as Behavior>::Protocol as Protocol>::Addr as Address>::Nonce: Sync, <C as Behavior>::Sends: Sync, <<<C as Behavior>::Protocol as Protocol>::Addr as EndpointAddress>::Installed<C>: Sync, C: Sync, <C as Behavior>::Ph: Sync, <<C as Behavior>::Birth as BirthMode>::Child: Sync,

§

impl<C, Occurrence> Unpin for ChildCreationOutcome<C, Occurrence>
where <<C as Behavior>::Protocol as Protocol>::Addr: Sized, <C as Behavior>::Error: Unpin, <<<C as Behavior>::Protocol as Protocol>::Addr as Address>::Nonce: Unpin, <C as Behavior>::Sends: Unpin, <<<C as Behavior>::Protocol as Protocol>::Addr as EndpointAddress>::Installed<C>: Unpin, C: Unpin, <C as Behavior>::Ph: Unpin, <<C as Behavior>::Birth as BirthMode>::Child: Unpin,

§

impl<C, Occurrence> UnsafeUnpin for ChildCreationOutcome<C, Occurrence>

§

impl<C, Occurrence> UnwindSafe for ChildCreationOutcome<C, Occurrence>

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.