Skip to main content

ProxyClient

Trait ProxyClient 

Source
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§

Source

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

Source

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

Source

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

Source

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

Source

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

Implementors§