Struct distant_core::DistantManagerClient
source · [−]pub struct DistantManagerClient { /* private fields */ }
Expand description
Represents a client that can connect to a remote distant manager
Implementations
sourceimpl DistantManagerClient
impl DistantManagerClient
sourcepub fn new<T>(config: DistantManagerClientConfig, transport: T) -> Result<Self> where
T: IntoSplit + 'static,
T::Read: UntypedTransportRead + 'static,
T::Write: UntypedTransportWrite + 'static,
pub fn new<T>(config: DistantManagerClientConfig, transport: T) -> Result<Self> where
T: IntoSplit + 'static,
T::Read: UntypedTransportRead + 'static,
T::Write: UntypedTransportWrite + 'static,
Initializes a client using the provided [UntypedTransport
]
sourcepub async fn launch(
&mut self,
destination: impl Into<Destination>,
options: impl Into<Map>
) -> Result<Destination>
pub async fn launch(
&mut self,
destination: impl Into<Destination>,
options: impl Into<Map>
) -> Result<Destination>
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 to connect to
sourcepub async fn connect(
&mut self,
destination: impl Into<Destination>,
options: impl Into<Map>
) -> Result<ConnectionId>
pub async fn connect(
&mut self,
destination: impl Into<Destination>,
options: impl Into<Map>
) -> Result<ConnectionId>
Request that the manager establishes a new connection at the given destination
with options
being passed for destination-specific details
sourcepub async fn open_channel(
&mut self,
connection_id: ConnectionId
) -> Result<DistantChannel>
pub async fn open_channel(
&mut self,
connection_id: ConnectionId
) -> Result<DistantChannel>
Establishes a channel with the server represented by the connection_id
,
returning a DistantChannel
acting as the connection
Note
Multiple calls to open a channel against the same connection will result in
clones of the same DistantChannel
rather than establishing a duplicate
remote connection to the same server
sourcepub async fn open_raw_channel(
&mut self,
connection_id: ConnectionId
) -> Result<RawDistantChannel>
pub async fn open_raw_channel(
&mut self,
connection_id: ConnectionId
) -> Result<RawDistantChannel>
Establishes a channel with the server represented by the connection_id
,
returning a [Transport
] acting as the connection
Note
Multiple calls to open a channel against the same connection will result in establishing a duplicate remote connections to the same server, so take care when using this method
sourcepub async fn capabilities(&mut self) -> Result<ManagerCapabilities>
pub async fn capabilities(&mut self) -> Result<ManagerCapabilities>
Retrieves a list of supported capabilities
sourcepub async fn info(&mut self, id: ConnectionId) -> Result<ConnectionInfo>
pub async fn info(&mut self, id: ConnectionId) -> Result<ConnectionInfo>
Retrieves information about a specific connection
sourcepub async fn kill(&mut self, id: ConnectionId) -> Result<()>
pub async fn kill(&mut self, id: ConnectionId) -> Result<()>
Kills the specified connection
sourcepub async fn list(&mut self) -> Result<ConnectionList>
pub async fn list(&mut self) -> Result<ConnectionList>
Retrieves a list of active connections
Trait Implementations
sourceimpl Drop for DistantManagerClient
impl Drop for DistantManagerClient
sourceimpl TcpDistantManagerClientExt for DistantManagerClient
impl TcpDistantManagerClientExt for DistantManagerClient
sourcefn connect<'async_trait, C>(
config: DistantManagerClientConfig,
addr: SocketAddr,
codec: C
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
C: Codec + Send + 'static,
C: 'async_trait,
Self: 'async_trait,
fn connect<'async_trait, C>(
config: DistantManagerClientConfig,
addr: SocketAddr,
codec: C
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
C: Codec + Send + 'static,
C: 'async_trait,
Self: 'async_trait,
Connect to a remote TCP server using the provided information
sourcefn connect_timeout<'async_trait, C>(
config: DistantManagerClientConfig,
addr: SocketAddr,
codec: C,
duration: Duration
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
C: Codec + Send + 'static,
C: 'async_trait,
Self: Send + 'async_trait,
fn connect_timeout<'async_trait, C>(
config: DistantManagerClientConfig,
addr: SocketAddr,
codec: C,
duration: Duration
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
C: Codec + Send + 'static,
C: 'async_trait,
Self: Send + 'async_trait,
Connect to a remote TCP server, timing out after duration has passed
sourceimpl UnixSocketDistantManagerClientExt for DistantManagerClient
impl UnixSocketDistantManagerClientExt for DistantManagerClient
sourcefn connect<'async_trait, P, C>(
config: DistantManagerClientConfig,
path: P,
codec: C
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
P: AsRef<Path> + Send,
C: Codec + Send + 'static,
P: 'async_trait,
C: 'async_trait,
fn connect<'async_trait, P, C>(
config: DistantManagerClientConfig,
path: P,
codec: C
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
P: AsRef<Path> + Send,
C: Codec + Send + 'static,
P: 'async_trait,
C: 'async_trait,
Connect to a proxy unix socket
sourcefn connect_timeout<'async_trait, P, C>(
config: DistantManagerClientConfig,
path: P,
codec: C,
duration: Duration
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
P: AsRef<Path> + Send,
C: Codec + Send + 'static,
P: 'async_trait,
C: 'async_trait,
Self: Send + 'async_trait,
fn connect_timeout<'async_trait, P, C>(
config: DistantManagerClientConfig,
path: P,
codec: C,
duration: Duration
) -> Pin<Box<dyn Future<Output = Result<DistantManagerClient>> + Send + 'async_trait>> where
P: AsRef<Path> + Send,
C: Codec + Send + 'static,
P: 'async_trait,
C: 'async_trait,
Self: Send + 'async_trait,
Connect to a proxy unix socket, timing out after duration has passed
Auto Trait Implementations
impl !RefUnwindSafe for DistantManagerClient
impl Send for DistantManagerClient
impl !Sync for DistantManagerClient
impl Unpin for DistantManagerClient
impl !UnwindSafe for DistantManagerClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more