pub struct Client {
pub stream: TcpStream,
/* private fields */
}Fields§
§stream: TcpStreamImplementations§
Source§impl Client
impl Client
pub fn block_until_receive( &mut self, timeout: Duration, ) -> Result<PacketReceiveStatus>
pub fn connect<B: ToSocketAddrs>( addr: B, config: &ClientConfig, ) -> Result<Client>
pub fn is_connected(&self) -> bool
pub fn receive<A: Serialize + DeserializeOwned>(&mut self) -> Result<Option<A>>
Sourcepub fn receive_blocking<A: Serialize + DeserializeOwned>(
&mut self,
timeout: Duration,
) -> Result<Option<A>>
pub fn receive_blocking<A: Serialize + DeserializeOwned>( &mut self, timeout: Duration, ) -> Result<Option<A>>
Block the thread until a packet has been received from the thread.
pub fn send<A: Serialize + DeserializeOwned>( &mut self, packet: &A, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin 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