pub struct MessageClient<Q, S, E> { /* private fields */ }Expand description
Sends requests to the associated MessageProcessor.
Instances are created by the
message_channel function.
Implementations§
Source§impl<Q, S, E> MessageClient<Q, S, E>
impl<Q, S, E> MessageClient<Q, S, E>
Sourcepub fn send_oneshot(&self, request: Q) -> Result<(), ChannelError>
pub fn send_oneshot(&self, request: Q) -> Result<(), ChannelError>
Sends a one-way request to the corresponding receiver. Use MessageClient::send if the receiver should be able to respond.
Sourcepub async fn send(&self, request: Q) -> Result<Result<S, E>, ChannelError>
pub async fn send(&self, request: Q) -> Result<Result<S, E>, ChannelError>
Sends a request to the corresponding receiver where it can be responded to.
Trait Implementations§
Source§impl<Q, S, E> Clone for MessageClient<Q, S, E>
impl<Q, S, E> Clone for MessageClient<Q, S, E>
Auto Trait Implementations§
impl<Q, S, E> Freeze for MessageClient<Q, S, E>
impl<Q, S, E> RefUnwindSafe for MessageClient<Q, S, E>
impl<Q, S, E> Send for MessageClient<Q, S, E>
impl<Q, S, E> Sync for MessageClient<Q, S, E>
impl<Q, S, E> Unpin for MessageClient<Q, S, E>
impl<Q, S, E> UnwindSafe for MessageClient<Q, S, E>
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