Skip to main content

SourceAdmission

Trait SourceAdmission 

Source
pub trait SourceAdmission<RootEvent, Source, Input>: Send
where RootEvent: EventIngress<Source, Input>,
{ // Required method fn admit_source( &mut self, input: &mut Option<Input>, reply: &mut Option<Result<(), Input>>, ) -> impl Future<Output = ()> + Send; }
Expand description

Bombay ownership port for one exact current-actor system input.

Success transfers the input to the existing actor loop. Closed admission returns the unchanged input to the current lifecycle host.

An event without the exact source ingress cannot implement this port:

ⓘ
struct EventWithoutInput;
struct Owner;
struct Input;
struct Host;
impl behavior::SourceAdmission<EventWithoutInput, Owner, Input> for Host {
    fn admit_source(&mut self, input: &mut Option<Input>, reply: &mut Option<Result<(), Input>>)
        -> impl core::future::Future<Output = ()> + Send
    {
        async move {
            if let Some(input) = input.take() { *reply = Some(Err(input)); }
        }
    }
}

Required Methods§

Source

fn admit_source( &mut self, input: &mut Option<Input>, reply: &mut Option<Result<(), Input>>, ) -> impl Future<Output = ()> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§