pub struct ClientHandle { /* private fields */ }Expand description
Handle for sending messages and receiving events.
Implementations§
Source§impl ClientHandle
impl ClientHandle
Sourcepub fn send(&mut self, message: Vec<u8>) -> Result<(), ClientError>
pub fn send(&mut self, message: Vec<u8>) -> Result<(), ClientError>
Sends an SBE message to the server (non-blocking).
§Errors
Returns error if the channel is disconnected.
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Disconnects from the server.
Sourcepub fn poll(&mut self) -> Option<ClientEvent>
pub fn poll(&mut self) -> Option<ClientEvent>
Polls for events (non-blocking).
Sourcepub fn poll_spin(&mut self) -> ClientEvent
pub fn poll_spin(&mut self) -> ClientEvent
Busy-poll for next event (for hot path).
Sourcepub fn drain(&mut self) -> impl Iterator<Item = ClientEvent> + '_
pub fn drain(&mut self) -> impl Iterator<Item = ClientEvent> + '_
Drains all available events.
Auto Trait Implementations§
impl !Freeze for ClientHandle
impl !RefUnwindSafe for ClientHandle
impl Send for ClientHandle
impl !Sync for ClientHandle
impl Unpin for ClientHandle
impl UnwindSafe for ClientHandle
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