Skip to main content

EstablishedCreation

Enum EstablishedCreation 

Source
pub enum EstablishedCreation<C, Occurrence>{
    Installed(CommittedChild<C, Occurrence>),
    Rejected {
        id: CreationId,
        kind: CreationKind,
        reason: CreationRejection,
        occurrence: PhantomData<fn() -> Occurrence>,
    },
}
Expand description

Committed or rejected result for one exact concrete child occurrence.

Installed is constructed only after fresh allocation, successful initialization, endpoint establishment, and creator-local binding. It returns the exact installed actor. Rejected carries no capability, so a failed request cannot be used as an established destination. Both variants preserve Behavior-authored creation provenance.

Occurrence is topology navigation evidence authored by the parent. It distinguishes duplicate occurrences without becoming another protocol identity or runtime key. A consumer that only sends messages may project the protocol recipient without retaining the installed actor.

A rejected named report has no actor capability to extract:

ⓘ
fn rejected_actor<C, Occurrence>(report: behavior::EstablishedCreation<C, Occurrence>)
where
    C: behavior::Behavior,
    behavior::BehaviorAddr<C>: behavior::EndpointAddress,
{
    let behavior::EstablishedCreation::Rejected { actor, .. } = report else { return; };
    let _: behavior::EstablishedActor<C> = actor;
}

Duplicate occurrences remain incompatible even when their protocols and endpoint representations match:

ⓘ
fn wrong_occurrence<C, Primary, Backup>(backup: behavior::EstablishedCreation<C, Backup>)
where
    C: behavior::Behavior,
    behavior::BehaviorAddr<C>: behavior::EndpointAddress,
{
    let _: behavior::EstablishedCreation<C, Primary> = backup;
}

Variants§

§

Installed(CommittedChild<C, Occurrence>)

§

Rejected

Fields

§occurrence: PhantomData<fn() -> Occurrence>

Implementations§

Source§

impl<C, Occurrence> EstablishedCreation<C, Occurrence>

Source

pub const fn installed(child: CommittedChild<C, Occurrence>) -> Self

Source

pub const fn rejected( id: CreationId, kind: CreationKind, reason: CreationRejection, ) -> Self

Source

pub const fn id(&self) -> CreationId

Source

pub const fn kind(&self) -> CreationKind

Source

pub fn into_recipient( self, ) -> Result<EstablishedRecipient<C::Protocol>, CreationRejection>

Consume the report and return its exact endpoint capability.

§Errors

Returns the original CreationRejection when child creation did not commit.

Source

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

Transfer the concrete committed child without recreating authority from a protocol recipient.

§Errors

Returns the original CreationRejection when child creation did not commit.

Auto Trait Implementations§

§

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

§

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

§

impl<C, Occurrence> Send for EstablishedCreation<C, Occurrence>

§

impl<C, Occurrence> Sync for EstablishedCreation<C, Occurrence>

§

impl<C, Occurrence> Unpin for EstablishedCreation<C, Occurrence>

§

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

§

impl<C, Occurrence> UnwindSafe for EstablishedCreation<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.