pub struct RUMClientHandle { /* private fields */ }
Expand description
Handle struct containing a reference to the global Tokio runtime and an instance of SafeClient. This handle allows sync codebases to interact with the async primitives built on top of Tokio. Specifically, this handle allows wrapping of the async connect, send, and receive methods implemented in RUMClient.
Implementations§
Source§impl RUMClientHandle
impl RUMClientHandle
pub fn connect(ip: &str, port: u16) -> RUMResult<RUMClientHandle>
pub fn new(ip: &str, port: u16) -> RUMResult<RUMClientHandle>
Sourcepub fn send(&mut self, msg: &RUMNetMessage) -> RUMResult<()>
pub fn send(&mut self, msg: &RUMNetMessage) -> RUMResult<()>
Queues a message send via the tokio runtime.
Sourcepub fn receive(&mut self) -> RUMResult<RUMNetMessage>
pub fn receive(&mut self) -> RUMResult<RUMNetMessage>
Checks if there are any messages received by the RUMClient via the tokio runtime.
Sourcepub fn get_address(&self) -> Option<RUMString>
pub fn get_address(&self) -> Option<RUMString>
Returns the peer address:port as a string.
Auto Trait Implementations§
impl Freeze for RUMClientHandle
impl !RefUnwindSafe for RUMClientHandle
impl Send for RUMClientHandle
impl Sync for RUMClientHandle
impl Unpin for RUMClientHandle
impl !UnwindSafe for RUMClientHandle
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