pub struct UntypedChannel { /* 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.
In contrast to Channel
, this implementation is untyped, meaning that the payload of
requests and responses are not validated.
Implementations§
Source§impl UntypedChannel
impl UntypedChannel
Sourcepub fn into_typed_channel<T, U>(self) -> Channel<T, U>
pub fn into_typed_channel<T, U>(self) -> Channel<T, U>
Consumes this channel, returning a typed variant
Sourcepub async fn assign_default_mailbox(
&self,
buffer: usize,
) -> Result<Mailbox<UntypedResponse<'static>>>
pub async fn assign_default_mailbox( &self, buffer: usize, ) -> Result<Mailbox<UntypedResponse<'static>>>
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: UntypedRequest<'_>,
) -> Result<Mailbox<UntypedResponse<'static>>>
pub async fn mail( &mut self, req: UntypedRequest<'_>, ) -> Result<Mailbox<UntypedResponse<'static>>>
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: UntypedRequest<'_>,
duration: impl Into<Option<Duration>>,
) -> Result<Mailbox<UntypedResponse<'static>>>
pub async fn mail_timeout( &mut self, req: UntypedRequest<'_>, duration: impl Into<Option<Duration>>, ) -> Result<Mailbox<UntypedResponse<'static>>>
Sends a request and returns a mailbox, timing out after duration has passed
Sourcepub async fn send(
&mut self,
req: UntypedRequest<'_>,
) -> Result<UntypedResponse<'static>>
pub async fn send( &mut self, req: UntypedRequest<'_>, ) -> Result<UntypedResponse<'static>>
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: UntypedRequest<'_>,
duration: impl Into<Option<Duration>>,
) -> Result<UntypedResponse<'static>>
pub async fn send_timeout( &mut self, req: UntypedRequest<'_>, duration: impl Into<Option<Duration>>, ) -> Result<UntypedResponse<'static>>
Sends a request and waits for a response, timing out after duration has passed
Sourcepub async fn fire(&mut self, req: UntypedRequest<'_>) -> Result<()>
pub async fn fire(&mut self, req: UntypedRequest<'_>) -> Result<()>
Sends a request without waiting for a response; this method is able to be used even if the session’s receiving line to the remote server has been severed
Sourcepub async fn fire_timeout(
&mut self,
req: UntypedRequest<'_>,
duration: impl Into<Option<Duration>>,
) -> Result<()>
pub async fn fire_timeout( &mut self, req: UntypedRequest<'_>, duration: impl Into<Option<Duration>>, ) -> Result<()>
Sends a request without waiting for a response, timing out after duration has passed