pub trait ProxyClient: Send + Sync {
// Required methods
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<IncomingMessage>, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn request_rendezvous<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn request_identity<'life0, 'async_trait>(
&'life0 self,
code: RendezvousCode,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_to<'life0, 'async_trait>(
&'life0 self,
fingerprint: IdentityFingerprint,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait abstracting the proxy client for communication between devices
Required Methods§
Sourcefn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<IncomingMessage>, ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<IncomingMessage>, ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the proxy server, returning a receiver for incoming messages
Sourcefn request_rendezvous<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn request_rendezvous<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request a rendezvous code from the proxy server
Sourcefn request_identity<'life0, 'async_trait>(
&'life0 self,
code: RendezvousCode,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn request_identity<'life0, 'async_trait>(
&'life0 self,
code: RendezvousCode,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request the identity associated with a rendezvous code
Sourcefn send_to<'life0, 'async_trait>(
&'life0 self,
fingerprint: IdentityFingerprint,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_to<'life0, 'async_trait>(
&'life0 self,
fingerprint: IdentityFingerprint,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a message to a peer by their fingerprint
Sourcefn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect from the proxy server