Skip to main content

AsyncTransport

Trait AsyncTransport 

Source
pub trait AsyncTransport: Stream<Item = Result<Bytes, Error>> + Unpin {
    // Required methods
    fn emit<'life0, 'async_trait>(
        &'life0 self,
        data: Bytes,
        is_binary_att: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn base_url<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Url, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_base_url<'life0, 'async_trait>(
        &'life0 self,
        base_url: Url,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn address<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Url, Error>> + Send + 'async_trait>>
       where Self: Sized + Sync + 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn emit<'life0, 'async_trait>( &'life0 self, data: Bytes, is_binary_att: bool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends a packet to the server. This optionally handles sending of a socketio binary attachment via the boolean attribute is_binary_att.

Source

fn base_url<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Url, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns start of the url. ex. http://localhost:2998/engine.io/?EIO=4&transport=polling Must have EIO and transport already set.

Source

fn set_base_url<'life0, 'async_trait>( &'life0 self, base_url: Url, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Used to update the base path, like when adding the sid.

Provided Methods§

Source

fn address<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Url, Error>> + Send + 'async_trait>>
where Self: Sized + Sync + 'async_trait, 'life0: 'async_trait,

Full query address

Implementors§