pub struct Stack;
Expand description

The operating system’s network stack, implementing embedded_nal_async::UdpStack.

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.

Trait Implementations§

source§

impl Clone for Stack

source§

fn clone(&self) -> Stack

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Stack

source§

fn default() -> Stack

Returns the “default value” for a type. Read more
source§

impl Dns for Stack

§

type Error = Error

The type returned when we have an error
source§

async fn get_host_by_name( &self, hostname: &str, addr_type: AddrType ) -> Result<IpAddr, Self::Error>

Resolve the first ip address of a host, given its hostname and a desired address record type to look for
source§

async fn get_host_by_address( &self, addr: IpAddr, result: &mut [u8] ) -> Result<usize, Self::Error>

Resolve the hostname of a host, given its ip address. Read more
source§

impl TcpConnect for Stack

§

type Error = Error

Error type returned on connect failure.
§

type Connection<'a> = TcpConnection

Type holding state of a TCP connection. Should close the connection when dropped.
source§

async fn connect<'a>( &'a self, addr: SocketAddr ) -> Result<Self::Connection<'a>, Error>

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

impl UdpStack for Stack

§

type Error = Error

Error type returned on socket creation failure.
§

type Connected = ConnectedSocket

Eventual socket return type of the [.connect()] method
§

type UniquelyBound = UniquelyBoundSocket

Eventual socket return type of the [.bind_single()] method
§

type MultiplyBound = MultiplyBoundSocket

Eventual return type of the [.bind_multiple()] method
source§

async fn connect_from( &self, local: SocketAddr, remote: SocketAddr ) -> Result<(SocketAddr, Self::Connected), Self::Error>

Create a socket that has a fixed remote address. Read more
source§

async fn bind_single( &self, local: SocketAddr ) -> Result<(SocketAddr, Self::UniquelyBound), Self::Error>

Create a socket that has a fixed local address. Read more
source§

async fn bind_multiple( &self, local: SocketAddr ) -> Result<Self::MultiplyBound, Self::Error>

Create a socket that has no single fixed local address. Read more
source§

async fn connect( &self, remote: SocketAddr ) -> Result<(SocketAddr, Self::Connected), Self::Error>

Create a socket that has a fixed remote address. Read more

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

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more