Skip to main content

EstablishedCreation

Enum EstablishedCreation 

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

Committed or rejected result for one exact child-protocol occurrence.

Installed is constructed only after fresh allocation, successful initialization, endpoint establishment, and creator-local binding. It returns the exact protocol capability. 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. P remains canonical identity. The concrete child behavior is deliberately absent: consumers that only retain or communicate with the installed protocol do not have to pretend to be parent actors.

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

ⓘ
use behavior::{
    Address, CreationKind, CreationSequence, EndpointAddress, EstablishedCreation,
    EstablishedRecipient, Protocol,
};
#[derive(Clone, Copy, PartialEq, Eq)]
struct RuntimeAddr(u64);
impl Address for RuntimeAddr { type Nonce = u64; }
struct Endpoint;
impl Clone for Endpoint { fn clone(&self) -> Self { Self } }
impl EndpointAddress for RuntimeAddr {
    type Established<P> = Endpoint where P: Protocol<Addr = Self>;
}
struct Worker;
impl Protocol for Worker { type Addr = RuntimeAddr; type Msg = (); }
struct Primary;
struct Backup;
fn accepts_primary(_: EstablishedCreation<Worker, Primary>) {}
let mut sequence = CreationSequence::new();
let id = sequence.issue().expect("fixture creation ID");
let backup: EstablishedCreation<Worker, Backup> = EstablishedCreation::installed(
    id,
    CreationKind::Birth,
    EstablishedRecipient::issued(Endpoint),
);
accepts_primary(backup);

Variants§

§

Installed

Fields

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

Rejected

Fields

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

Implementations§

Source§

impl<P, Occurrence> EstablishedCreation<P, Occurrence>

Source

pub const fn installed( id: CreationId, kind: CreationKind, recipient: EstablishedRecipient<P>, ) -> 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<P>, 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_actor<Parent>( self, ) -> Result<EstablishedActor<RoleChild<Parent, Occurrence>>, CreationRejection>
where Parent: Behavior, Occurrence: ChildRole<Parent>, RoleChild<Parent, Occurrence>: Behavior<Protocol = P>,

Recover the concrete installed-actor proof when this occurrence is a declared role of Parent.

Parent is used only as compile-time topology evidence at this capability-strengthening boundary; it is not part of the creation-report identity. Ordinary consumers can retain EstablishedRecipient<P> without carrying the parent behavior.

§Errors

Returns the original CreationRejection when child creation did not commit.

Auto Trait Implementations§

§

impl<P, Occurrence> Freeze for EstablishedCreation<P, Occurrence>
where <P as Protocol>::Addr: Sized, EstablishedRecipient<P>: Freeze, PhantomData<fn() -> Occurrence>: Freeze,

§

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

§

impl<P, Occurrence> Send for EstablishedCreation<P, Occurrence>
where <P as Protocol>::Addr: Sized, EstablishedRecipient<P>: Send, PhantomData<fn() -> Occurrence>: Send,

§

impl<P, Occurrence> Sync for EstablishedCreation<P, Occurrence>
where <P as Protocol>::Addr: Sized, EstablishedRecipient<P>: Sync, PhantomData<fn() -> Occurrence>: Sync,

§

impl<P, Occurrence> Unpin for EstablishedCreation<P, Occurrence>
where <P as Protocol>::Addr: Sized, EstablishedRecipient<P>: Unpin, PhantomData<fn() -> Occurrence>: Unpin,

§

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

§

impl<P, Occurrence> UnwindSafe for EstablishedCreation<P, Occurrence>
where <P as Protocol>::Addr: Sized, EstablishedRecipient<P>: UnwindSafe, PhantomData<fn() -> Occurrence>: 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.