Struct embedded_nal::SharedStack[][src]

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

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

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

Trait Implementations

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

type TcpSocket = T::TcpSocket

The type returned when we create a new TCP socket

type Error = T::Error

The type returned when we have an error

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

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

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

Connect to the given remote host and port. Read more

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

Write to the stream. Read more

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

Receive data from the stream. Read more

fn is_connected(
    &mut self,
    socket: &Self::TcpSocket
) -> Result<bool, Self::Error>
[src]

Check if this socket is connected

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

Close an existing TCP socket.

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

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

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

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

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

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

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

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

type Error = T::Error

The type returned when we have an error

type UdpSocket = T::UdpSocket

The type returned when we create a new UDP socket

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

Allocate a socket for further use.

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

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

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

Send a datagram to the remote host. Read more

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

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

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

Close an existing UDP socket.

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

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

Bind a UDP socket with a specified port

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

Send a packet to a remote host/port.

Auto Trait Implementations

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

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

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.