Skip to main content

PolyboxExt

Trait PolyboxExt 

Source
pub trait PolyboxExt: PolyBox {
    // Provided methods
    fn into_dyn_subset<T>(self) -> DynInbox<T>
       where T: SubsetOf<Self::Set> { ... }
    fn into_dyn(self) -> DynInbox<Self::Set> { ... }
    fn into_dyn_checked<T: Members>(self) -> Result<DynInbox<T>, Self> { ... }
    fn accepts_msg(&self, id: TypeId) -> bool { ... }
    fn accepts_msgs(&self, ids: &[TypeId]) -> bool { ... }
    fn send_checked<T: Message>(
        &self,
        msg: T,
    ) -> impl Future<Output = Result<Output<T>, SendCheckedError<T>>> + Send { ... }
    fn send_checked_blocking<T: Message>(
        &self,
        msg: T,
    ) -> Result<Output<T>, SendCheckedError<T>> { ... }
}
Expand description

A trait that extends PolyBox with some helper methods.

Provided Methods§

Source

fn into_dyn_subset<T>(self) -> DynInbox<T>
where T: SubsetOf<Self::Set>,

Converts into a dynamic inbox with a subset of the original types.

This conversion is type-safe, and entirely at compile-time.

Source

fn into_dyn(self) -> DynInbox<Self::Set>

Converts into a dynamic inbox with the full set of original types.

Source

fn into_dyn_checked<T: Members>(self) -> Result<DynInbox<T>, Self>

Converts into a dynamic inbox, checking at runtime if the types are compatible.

Source

fn accepts_msg(&self, id: TypeId) -> bool

Checks if the inbox accepts a message of the given type.

Source

fn accepts_msgs(&self, ids: &[TypeId]) -> bool

Checks if the inbox accepts messages of the given types.

Source

fn send_checked<T: Message>( &self, msg: T, ) -> impl Future<Output = Result<Output<T>, SendCheckedError<T>>> + Send

Send any message, checking at runtime if the message is accepted or not.

Source

fn send_checked_blocking<T: Message>( &self, msg: T, ) -> Result<Output<T>, SendCheckedError<T>>

Same as Self::send_checked, but blocks the current thread until the message is sent.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§