Struct rust_engineio::client::Client
source · pub struct Client { /* private fields */ }
Expand description
An engine.io client that allows interaction with the connected engine.io server. This client provides means for connecting, disconnecting and sending packets to the server.
Note:
There is no need to put this Client behind an Arc
, as the type uses Arc
internally and provides a shared state beyond all cloned instances.
Implementations§
source§impl Client
impl Client
pub fn close(&self) -> Result<(), Error>
sourcepub fn connect(&self) -> Result<(), Error>
pub fn connect(&self) -> Result<(), Error>
Opens the connection to a specified server. The first Pong packet is sent to the server to trigger the Ping-cycle.
sourcepub fn disconnect(&self) -> Result<(), Error>
pub fn disconnect(&self) -> Result<(), Error>
Disconnects the connection.
sourcepub fn is_connected(&self) -> Result<bool, Error>
pub fn is_connected(&self) -> Result<bool, Error>
Check if the underlying transport client is connected.
pub fn iter(&self) -> Iter<'_> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more