pub struct Channel<T, U> { /* private fields */ }
Expand description
Represents a sender of requests tied to a session, holding onto a weak reference of
mailboxes to relay responses, meaning that once the Client
is closed or dropped,
any sent request will no longer be able to receive responses.
Implementations§
Source§impl<T, U> Channel<T, U>
impl<T, U> Channel<T, U>
Sourcepub fn into_untyped_channel(self) -> UntypedChannel
pub fn into_untyped_channel(self) -> UntypedChannel
Consumes this channel, returning an untyped variant
Sourcepub async fn assign_default_mailbox(
&self,
buffer: usize,
) -> Result<Mailbox<Response<U>>>
pub async fn assign_default_mailbox( &self, buffer: usize, ) -> Result<Mailbox<Response<U>>>
Assigns a default mailbox for any response received that does not match another mailbox.
Sourcepub async fn remove_default_mailbox(&self) -> Result<()>
pub async fn remove_default_mailbox(&self) -> Result<()>
Removes the default mailbox used for unmatched responses such that any response without a matching mailbox will be dropped.
Sourcepub async fn mail(
&mut self,
req: impl Into<Request<T>>,
) -> Result<Mailbox<Response<U>>>
pub async fn mail( &mut self, req: impl Into<Request<T>>, ) -> Result<Mailbox<Response<U>>>
Sends a request and returns a mailbox that can receive one or more responses, failing if unable to send a request or if the session’s receiving line to the remote server has already been severed
Sourcepub async fn mail_timeout(
&mut self,
req: impl Into<Request<T>>,
duration: impl Into<Option<Duration>>,
) -> Result<Mailbox<Response<U>>>
pub async fn mail_timeout( &mut self, req: impl Into<Request<T>>, duration: impl Into<Option<Duration>>, ) -> Result<Mailbox<Response<U>>>
Sends a request and returns a mailbox, timing out after duration has passed
Sourcepub async fn send(&mut self, req: impl Into<Request<T>>) -> Result<Response<U>>
pub async fn send(&mut self, req: impl Into<Request<T>>) -> Result<Response<U>>
Sends a request and waits for a response, failing if unable to send a request or if the session’s receiving line to the remote server has already been severed
Sourcepub async fn send_timeout(
&mut self,
req: impl Into<Request<T>>,
duration: impl Into<Option<Duration>>,
) -> Result<Response<U>>
pub async fn send_timeout( &mut self, req: impl Into<Request<T>>, duration: impl Into<Option<Duration>>, ) -> Result<Response<U>>
Sends a request and waits for a response, timing out after duration has passed