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§
Sourcefn emit(&self, data: Bytes, is_binary_att: bool) -> Result<(), Error>
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.
Sourcefn poll(&self, timeout: Duration) -> Result<Bytes, Error>
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.
Provided Methods§
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".