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§
Sourcefn into_dyn_subset<T>(self) -> DynInbox<T>
fn into_dyn_subset<T>(self) -> DynInbox<T>
Converts into a dynamic inbox with a subset of the original types.
This conversion is type-safe, and entirely at compile-time.
Sourcefn into_dyn(self) -> DynInbox<Self::Set>
fn into_dyn(self) -> DynInbox<Self::Set>
Converts into a dynamic inbox with the full set of original types.
Sourcefn into_dyn_checked<T: Members>(self) -> Result<DynInbox<T>, Self>
fn into_dyn_checked<T: Members>(self) -> Result<DynInbox<T>, Self>
Converts into a dynamic inbox, checking at runtime if the types are compatible.
Sourcefn accepts_msg(&self, id: TypeId) -> bool
fn accepts_msg(&self, id: TypeId) -> bool
Checks if the inbox accepts a message of the given type.
Sourcefn accepts_msgs(&self, ids: &[TypeId]) -> bool
fn accepts_msgs(&self, ids: &[TypeId]) -> bool
Checks if the inbox accepts messages of the given types.
Sourcefn send_checked<T: Message>(
&self,
msg: T,
) -> impl Future<Output = Result<Output<T>, SendCheckedError<T>>> + Send
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.
Sourcefn send_checked_blocking<T: Message>(
&self,
msg: T,
) -> Result<Output<T>, SendCheckedError<T>>
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".