pub struct NetReceiver { /* private fields */ }Expand description
Represents a network receiver which wraps a ChannelBuffer.
Implementations§
Source§impl NetReceiver
impl NetReceiver
Sourcepub fn new(
channel_buffer: ChannelBuffer<BYTES_BUFFER_SIZE>,
addr: SocketAddr,
id: usize,
) -> Self
pub fn new( channel_buffer: ChannelBuffer<BYTES_BUFFER_SIZE>, addr: SocketAddr, id: usize, ) -> Self
Creates a new instance of a NetReceiver.
§Arguments
channel_buffer: the channel buffer to read bytes from.addr: the peer address.id: the network id associated to the client.
returns: NetReceiver
Sourcepub fn addr(&self) -> &SocketAddr
pub fn addr(&self) -> &SocketAddr
Returns the socket address.
Sourcepub fn close(self)
pub fn close(self)
Closes this ChannelBuffer.
Trait Implementations§
Source§impl AsyncRead for NetReceiver
impl AsyncRead for NetReceiver
Auto Trait Implementations§
impl Freeze for NetReceiver
impl RefUnwindSafe for NetReceiver
impl Send for NetReceiver
impl Sync for NetReceiver
impl Unpin for NetReceiver
impl UnwindSafe for NetReceiver
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