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: Input, ) -> impl Future<Output = Result<(), Input>> + 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 {
    async fn admit_source(&mut self, _: Input) -> Result<(), Input> { Ok(()) }
}

Required Methods§

Source

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

Attempt one source input without discarding closed-control ownership.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§