pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(random: Box<dyn SecureRandom>) -> Self
pub fn on_challenge( &mut self, cmd: InChallengeCommand, ) -> Result<(), DatagramConnectionsError>
pub fn on_connect( &mut self, cmd: ConnectResponse, ) -> Result<(), DatagramConnectionsError>
pub fn on_packet( &mut self, cmd: HostToClientPacketHeader, in_stream: &mut InOctetStream, ) -> Result<Vec<u8>, DatagramConnectionsError>
pub fn send_challenge( &mut self, ) -> Result<ClientToHostChallengeCommand, DatagramConnectionsError>
pub fn send_connect_request( &mut self, ) -> Result<ConnectCommand, DatagramConnectionsError>
pub fn send_packet( &mut self, data: &[u8], ) -> Result<ClientToHostPacket, DatagramConnectionsError>
pub fn send( &mut self, data: &[u8], ) -> Result<ClientToHostCommands, DatagramConnectionsError>
pub fn decode( &mut self, buffer: &[u8], ) -> Result<Vec<u8>, DatagramConnectionsError>
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 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