pub struct ServerConnection { /* private fields */ }Expand description
A complete bidirectional connection that combines Sender + Receiver
Implementations§
Source§impl ServerConnection
impl ServerConnection
Sourcepub fn new(connection_id: u16, address_hash: u64, max_fragments: usize) -> Self
pub fn new(connection_id: u16, address_hash: u64, max_fragments: usize) -> Self
Create a new server connection
Sourcepub fn receive(
&mut self,
datagram: &[u8],
sender_address_hash: u64,
) -> Option<(Vec<u8>, bool)>
pub fn receive( &mut self, datagram: &[u8], sender_address_hash: u64, ) -> Option<(Vec<u8>, bool)>
Process incoming datagram for this connection
Sourcepub fn is_inactive(&self, timeout: Duration) -> bool
pub fn is_inactive(&self, timeout: Duration) -> bool
Check if this connection is inactive
Sourcepub const fn connection_id(&self) -> u16
pub const fn connection_id(&self) -> u16
Get connection ID
Sourcepub const fn address_hash(&self) -> u64
pub const fn address_hash(&self) -> u64
Get address hash
Auto Trait Implementations§
impl Freeze for ServerConnection
impl !RefUnwindSafe for ServerConnection
impl !Send for ServerConnection
impl !Sync for ServerConnection
impl Unpin for ServerConnection
impl !UnwindSafe for ServerConnection
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