Struct std_embedded_nal::Stack
source · pub struct Stack;
Expand description
The operating system’s network stack, implementing embedded_nal::UdpFullStack
and others.
The user may instantiate a stack using the Stack::default()
function.
The stack can be cloned, as it is not a resource that needs any synchronization. This is not
made implicit as Copy, though (although there’s not technical reason not to). That is to alert
users to the difficulties that’d arise when copying around a stack rather than using it through
some mechanism of synchronization (which is generally required with embedded_nal
since
version 0.3).
Trait Implementations§
source§impl Dns for Stack
impl Dns for Stack
source§impl TcpClientStack for Stack
impl TcpClientStack for Stack
source§fn socket(&mut self) -> Result<TcpSocket, Self::Error>
fn socket(&mut self) -> Result<TcpSocket, Self::Error>
Open a socket for usage as a TCP client. Read more
source§fn connect(
&mut self,
socket: &mut TcpSocket,
remote: SocketAddr
) -> Result<(), Self::Error>
fn connect( &mut self, socket: &mut TcpSocket, remote: SocketAddr ) -> Result<(), Self::Error>
Connect to the given remote host and port. Read more
source§fn send(
&mut self,
socket: &mut TcpSocket,
buffer: &[u8]
) -> Result<usize, Self::Error>
fn send( &mut self, socket: &mut TcpSocket, buffer: &[u8] ) -> Result<usize, Self::Error>
Write to the stream. Read more
source§impl TcpFullStack for Stack
impl TcpFullStack for Stack
source§fn bind(&mut self, socket: &mut TcpSocket, port: u16) -> Result<(), Self::Error>
fn bind(&mut self, socket: &mut TcpSocket, port: u16) -> Result<(), Self::Error>
Create a new TCP socket and bind it to the specified local port. Read more
source§impl UdpClientStack for Stack
impl UdpClientStack for Stack
source§fn socket(&mut self) -> Result<Self::UdpSocket, Self::Error>
fn socket(&mut self) -> Result<Self::UdpSocket, Self::Error>
Allocate a socket for further use.
source§fn connect(
&mut self,
socket: &mut Self::UdpSocket,
remote: SocketAddr
) -> Result<()>
fn connect( &mut self, socket: &mut Self::UdpSocket, remote: SocketAddr ) -> Result<()>
Connect a UDP socket with a peer using a dynamically selected port. Read more
source§fn send(
&mut self,
socket: &mut Self::UdpSocket,
buffer: &[u8]
) -> Result<(), Self::Error>
fn send( &mut self, socket: &mut Self::UdpSocket, buffer: &[u8] ) -> Result<(), Self::Error>
Send a datagram to the remote host. Read more
source§impl UdpFullStack for Stack
impl UdpFullStack for Stack
Auto Trait Implementations§
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnwindSafe for Stack
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