pub struct SharedStack<'a, T> { /* private fields */ }
Expand description

Single-thread shared reference to an internal network stack implementation.

This can only be created by calling SharableStack::acquire()

Trait Implementations§

source§

impl<'a, T> TcpClientStack for SharedStack<'a, T>
where T: TcpClientStack,

§

type TcpSocket = <T as TcpClientStack>::TcpSocket

The type returned when we create a new TCP socket
§

type Error = <T as TcpClientStack>::Error

The type returned when we have an error
source§

fn socket(&mut self) -> Result<Self::TcpSocket, Self::Error>

Open a socket for usage as a TCP client. Read more
source§

fn connect( &mut self, socket: &mut Self::TcpSocket, address: SocketAddr ) -> Result<(), Error<<T as TcpClientStack>::Error>>

Connect to the given remote host and port. Read more
source§

fn send( &mut self, socket: &mut Self::TcpSocket, data: &[u8] ) -> Result<usize, Error<<T as TcpClientStack>::Error>>

Write to the stream. Read more
source§

fn receive( &mut self, socket: &mut Self::TcpSocket, data: &mut [u8] ) -> Result<usize, Error<<T as TcpClientStack>::Error>>

Receive data from the stream. Read more
source§

fn close(&mut self, socket: Self::TcpSocket) -> Result<(), Self::Error>

Close an existing TCP socket.
source§

impl<'a, T> TcpFullStack for SharedStack<'a, T>
where T: TcpFullStack,

source§

fn bind( &mut self, socket: &mut Self::TcpSocket, port: u16 ) -> Result<(), <T as TcpClientStack>::Error>

Create a new TCP socket and bind it to the specified local port. Read more
source§

fn listen( &mut self, socket: &mut Self::TcpSocket ) -> Result<(), <T as TcpClientStack>::Error>

Begin listening for connection requests on a previously-bound socket. Read more
source§

fn accept( &mut self, socket: &mut Self::TcpSocket ) -> Result<(<T as TcpClientStack>::TcpSocket, SocketAddr), Error<<T as TcpClientStack>::Error>>

Accept an active connection request on a listening socket. Read more
source§

impl<'a, T> UdpClientStack for SharedStack<'a, T>
where T: UdpClientStack,

§

type Error = <T as UdpClientStack>::Error

The type returned when we have an error
§

type UdpSocket = <T as UdpClientStack>::UdpSocket

The type returned when we create a new UDP socket
source§

fn socket(&mut self) -> Result<Self::UdpSocket, Self::Error>

Allocate a socket for further use.
source§

fn connect( &mut self, socket: &mut Self::UdpSocket, address: SocketAddr ) -> Result<(), Self::Error>

Connect a UDP socket with a peer using a dynamically selected port. Read more
source§

fn send( &mut self, socket: &mut Self::UdpSocket, data: &[u8] ) -> Result<(), Error<<T as UdpClientStack>::Error>>

Send a datagram to the remote host. Read more
source§

fn receive( &mut self, socket: &mut Self::UdpSocket, data: &mut [u8] ) -> Result<(usize, SocketAddr), Error<<T as UdpClientStack>::Error>>

Read a datagram the remote host has sent to us. Read more
source§

fn close(&mut self, socket: Self::UdpSocket) -> Result<(), Self::Error>

Close an existing UDP socket.
source§

impl<'a, T> UdpFullStack for SharedStack<'a, T>
where T: UdpFullStack,

source§

fn bind( &mut self, socket: &mut Self::UdpSocket, local_port: u16 ) -> Result<(), Self::Error>

Bind a UDP socket with a specified port
source§

fn send_to( &mut self, socket: &mut Self::UdpSocket, remote: SocketAddr, buffer: &[u8] ) -> Result<(), Error<<T as UdpClientStack>::Error>>

Send a packet to a remote host/port.

Auto Trait Implementations§

§

impl<'a, T> !RefUnwindSafe for SharedStack<'a, T>

§

impl<'a, T> !Send for SharedStack<'a, T>

§

impl<'a, T> !Sync for SharedStack<'a, T>

§

impl<'a, T> Unpin for SharedStack<'a, T>

§

impl<'a, T> !UnwindSafe for SharedStack<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.