Struct distant_net::client::Client

source ·
pub struct Client<T, U> { /* private fields */ }
Expand description

Represents a client that can be used to send requests & receive responses from a server.

Implementations

Consumes the client, returning an untyped variant.

Spawns a client using the provided FramedTransport of InmemoryTransport and a specific ReconnectStrategy.

Note

This will NOT perform any handshakes or authentication procedures nor will it replay any missing frames. This is to be used when establishing a Client to be run internally within a program.

Creates a new ClientBuilder.

Creates a new ClientBuilder configured to use a TcpConnector.

Creates a new ClientBuilder configured to use a UnixSocketConnector.

Convert into underlying channel.

Clones the underlying channel for requests and returns the cloned instance.

Waits for the client to terminate, which resolves when the receiving end of the network connection is closed (or the client is shutdown). Returns whether or not the client exited successfully or due to an error.

Abort the client’s current connection by forcing its tasks to abort.

Clones the underlying shutdown signaler for the client. This enables you to wait on the client while still having the option to shut it down from somewhere else.

Signal for the client to shutdown its connection cleanly.

Clones the underlying [ConnectionStateWatcher] for the client.

Spawns a new task that continually monitors for connection changes and invokes the function f whenever a new change is detected.

Returns true if client’s underlying event processing has finished/terminated.

Request that the manager launches a new server at the given destination with options being passed for destination-specific details, returning the new destination of the spawned server.

The provided handler will be used for any authentication requirements when connecting to the remote machine to spawn the server.

Request that the manager establishes a new connection at the given destination with options being passed for destination-specific details.

The provided handler will be used for any authentication requirements when connecting to the server.

Establishes a channel with the server represented by the connection_id, returning a RawChannel acting as the connection.

Note

Multiple calls to open a channel against the same connection will result in establishing a duplicate channel to the same server, so take care when using this method.

Retrieves a list of supported capabilities

Retrieves information about a specific connection

Kills the specified connection

Retrieves a list of active connections

Methods from Deref<Target = Channel<T, U>>

Returns true if no more requests can be transferred

Assigns a default mailbox for any response received that does not match another mailbox.

Removes the default mailbox used for unmatched responses such that any response without a matching mailbox will be dropped.

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 returns a mailbox, timing out after duration has passed

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

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

Sends a request without waiting for a response, timing out after duration has passed

Trait Implementations

Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.