Skip to main content

Transport

Trait Transport 

Source
pub trait Transport {
    // Required methods
    fn emit(&self, data: Bytes, is_binary_att: bool) -> Result<(), Error>;
    fn poll(&self, timeout: Duration) -> Result<Bytes, Error>;
    fn base_url(&self) -> Result<Url, Error>;
    fn set_base_url(&self, base_url: Url) -> Result<(), Error>;

    // Provided method
    fn address(&self) -> Result<Url, Error> { ... }
}

Required Methods§

Source

fn emit(&self, data: Bytes, is_binary_att: bool) -> Result<(), Error>

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

Source

fn poll(&self, timeout: Duration) -> Result<Bytes, Error>

Performs the server long polling procedure as long as the client is connected. This should run separately at all time to ensure proper response handling from the server.

Source

fn base_url(&self) -> Result<Url, Error>

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(&self, base_url: Url) -> Result<(), Error>

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

Provided Methods§

Source

fn address(&self) -> Result<Url, Error>

Full query address

Trait Implementations§

Source§

impl Debug for dyn Transport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§