embedded_nal

Struct SharedStack

Source
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,

Source§

type TcpSocket = <T as TcpClientStack>::TcpSocket

The type returned when we create a new TCP socket
Source§

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,

Source§

type Error = <T as UdpClientStack>::Error

The type returned when we have an error
Source§

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> Freeze for SharedStack<'a, T>

§

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>,

Source§

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>,

Source§

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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 4 bytes