pub struct ChannelTx<M: RemoteMessage> { /* private fields */ }
Expand description
Universal channel transmitter.
Trait Implementations§
Source§impl<M: RemoteMessage> Tx<M> for ChannelTx<M>
impl<M: RemoteMessage> Tx<M> for ChannelTx<M>
Source§fn try_post(
&self,
message: M,
return_channel: Sender<M>,
) -> Result<(), SendError<M>>
fn try_post( &self, message: M, return_channel: Sender<M>, ) -> Result<(), SendError<M>>
Enqueue a
message
on the local end of the channel. The
message is either delivered, or we eventually discover that
the channel has failed and it will be sent back on return_handle
.Source§fn addr(&self) -> ChannelAddr
fn addr(&self) -> ChannelAddr
The channel address to which this Tx is sending.
Source§fn post(&self, message: M)
fn post(&self, message: M)
Enqueue a message to be sent on the channel. The caller is expected to monitor
the channel status for failures.
Source§fn send<'life0, 'async_trait>(
&'life0 self,
message: M,
) -> Pin<Box<dyn Future<Output = Result<(), SendError<M>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
message: M,
) -> Pin<Box<dyn Future<Output = Result<(), SendError<M>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Send a message synchronously, returning when the messsage has
been delivered to the remote end of the channel.
Auto Trait Implementations§
impl<M> Freeze for ChannelTx<M>
impl<M> !RefUnwindSafe for ChannelTx<M>
impl<M> Send for ChannelTx<M>
impl<M> Sync for ChannelTx<M>
impl<M> Unpin for ChannelTx<M>where
M: Unpin,
impl<M> !UnwindSafe for ChannelTx<M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more