Skip to main content

FlumeInbox

Struct FlumeInbox 

Source
pub struct FlumeInbox<T> { /* private fields */ }
Expand description

A wrapper around a flume::Sender that acts as a PolyBox.

Implementations§

Source§

impl<T> FlumeInbox<T>

Source

pub fn new(buffer: usize) -> (Self, Receiver<T>)

Source

pub fn inner(&self) -> &Sender<T>

Source

pub fn into_inner(self) -> Sender<T>

Source

pub fn from_inner(sender: Sender<T>) -> Self

Trait Implementations§

Source§

impl<T> Clone for FlumeInbox<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Interface> DynPolyBox for FlumeInbox<T>

Source§

fn _send_boxed_payload_checked( &self, msg: BoxedPayload, ) -> BoxFuture<'_, Result<(), SendCheckedError<BoxedPayload>>>

Send a boxed payload.
Source§

fn _send_boxed_payload_checked_blocking( &self, msg: BoxedPayload, ) -> Result<(), SendCheckedError<BoxedPayload>>

Same as Self::_send_boxed_payload_checked, but blocks the current thread until the message is sent.
Source§

impl<T: Interface> PolyBox for FlumeInbox<T>

Source§

type Set = <T as AsSet>::Set

The set of message types that this inbox can accept.
Source§

fn into_dyn_unchecked<R>(self) -> DynInbox<R>

Converts into a dynamic inbox without checking if the types are compatible. Read more
Source§

impl<T, R> Sends<T> for FlumeInbox<R>
where T: Message, R: TryIntoPayload<T> + FromPayload<T> + Send,

Source§

async fn send(&self, msg: T) -> Result<Output<T>, SendError<T>>

Sends a message of type T to the inbox.
Source§

fn send_blocking( &self, msg: T, ) -> Result<<<T as Message>::Kind as MessageSpecifier<T>>::Output, SendError<T>>

Same as Sends::send, but blocks the current thread until the message is sent.

Auto Trait Implementations§

§

impl<T> Freeze for FlumeInbox<T>

§

impl<T> RefUnwindSafe for FlumeInbox<T>

§

impl<T> Send for FlumeInbox<T>
where T: Send,

§

impl<T> Sync for FlumeInbox<T>
where T: Send,

§

impl<T> Unpin for FlumeInbox<T>

§

impl<T> UnsafeUnpin for FlumeInbox<T>

§

impl<T> UnwindSafe for FlumeInbox<T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PolyboxExt for T
where T: PolyBox,

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. Read more
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>(self) -> Result<DynInbox<T>, Self>
where T: Members,

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>( &self, msg: T, ) -> impl Future<Output = Result<<<T as Message>::Kind as MessageSpecifier<T>>::Output, SendCheckedError<T>>> + Send
where T: Message,

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

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

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

impl<T, S> SendsExt<T> for S
where T: Message, S: Sends<T>,

Source§

fn request( &self, msg: T, ) -> impl Future<Output = Result<<<<T as Message>::Kind as MessageSpecifier<T>>::Output as MessageReply>::Reply, RequestError<T>>> + Send

Sends a message of type T to the inbox and waits for a reply, if the message type has a reply type. Read more
Source§

fn request_blocking( &self, msg: T, ) -> Result<<<<T as Message>::Kind as MessageSpecifier<T>>::Output as MessageReply>::Reply, RequestError<T>>

Same as SendsExt::request, but blocks the current thread until the reply is received.
Source§

impl<T, S> SupersetOf<S> for T
where S: SubsetOf<T>,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<S> Zero for S
where S: ?Sized,