Struct distant_core::Session [−][src]
pub struct Session { /* fields omitted */ }
Expand description
Represents a session with a remote server that can be used to send requests & receive responses
Implementations
pub async fn tcp_connect<U>(addr: SocketAddr, codec: U) -> Result<Self> where
U: Codec + Send + 'static,
pub async fn tcp_connect<U>(addr: SocketAddr, codec: U) -> Result<Self> where
U: Codec + Send + 'static,
Connect to a remote TCP server using the provided information
pub async fn tcp_connect_timeout<U>(
addr: SocketAddr,
codec: U,
duration: Duration
) -> Result<Self> where
U: Codec + Send + 'static,
pub async fn tcp_connect_timeout<U>(
addr: SocketAddr,
codec: U,
duration: Duration
) -> Result<Self> where
U: Codec + Send + 'static,
Connect to a remote TCP server, timing out after duration has passed
Connect to a proxy unix socket
pub fn initialize<T, U>(transport: Transport<T, U>) -> Result<Self> where
T: DataStream,
U: Codec + Send + 'static,
pub fn initialize<T, U>(transport: Transport<T, U>) -> Result<Self> where
T: DataStream,
U: Codec + Send + 'static,
Initializes a session using the provided transport
Waits for the session to terminate, which results when the receiving end of the network connection is closed (or the session is shutdown)
Abort the session’s current connection by forcing its response task to shutdown
Clones the underlying channel for requests and returns the cloned instance
Methods from Deref<Target = SessionChannel>
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
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
pub async fn send_timeout(
&mut self,
req: Request,
duration: Duration
) -> Result<Response, TransportError>
pub async fn send_timeout(
&mut self,
req: Request,
duration: Duration
) -> Result<Response, TransportError>
Sends a request and waits for a response, timing out after duration has passed
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
pub async fn fire_timeout(
&mut self,
req: Request,
duration: Duration
) -> Result<(), TransportError>
pub async fn fire_timeout(
&mut self,
req: Request,
duration: Duration
) -> Result<(), TransportError>
Sends a request without waiting for a response, timing out after duration has passed
Trait Implementations
type Target = SessionChannel
type Target = SessionChannel
The resulting type after dereferencing.