Skip to main content

Stack

Struct Stack 

Source
pub struct Stack(/* private fields */);
Expand description

The STD network stack implementation.

This uses the standard library’s networking types under the hood, wrapped in async-io’s Async type for async support.

The type is Copy and Clone, so it can be easily passed around.

Implementations§

Source§

impl Stack

Source

pub const fn new() -> Self

Create a new STD network stack instance.

Trait Implementations§

Source§

impl Clone for Stack

Source§

fn clone(&self) -> Stack

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Stack

Source§

impl Default for Stack

Source§

fn default() -> Stack

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

impl Dns for Stack

Source§

type Error = Error

The type returned when we have an error
Source§

async fn get_host_by_name( &self, host: &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 TcpBind for Stack

Source§

type Error = Error

Error type returned on bind failure
Source§

type Accept<'a> = TcpAcceptor where Self: 'a

The acceptor type returned by the factory
Source§

async fn bind(&self, local: SocketAddr) -> Result<Self::Accept<'_>, Self::Error>

Bind to a local socket listening for incoming connections Read more
Source§

impl TcpConnect for Stack

Source§

type Error = Error

Error type returned on socket creation failure
Source§

type Socket<'a> = TcpSocket where Self: 'a

The socket type returned by the factory
Source§

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

Connect to a remote socket
Source§

impl UdpBind for Stack

Source§

type Error = Error

Error type returned on socket creation failure
Source§

type Socket<'a> = UdpSocket where Self: 'a

The socket type returned by the stack
Source§

async fn bind(&self, local: SocketAddr) -> Result<Self::Socket<'_>, Self::Error>

Bind to a local socket address
Source§

impl UdpConnect for Stack

Source§

type Error = Error

Error type returned on socket creation failure
Source§

type Socket<'a> = UdpSocket where Self: 'a

The socket type returned by the factory
Source§

async fn connect( &self, local: SocketAddr, remote: SocketAddr, ) -> Result<Self::Socket<'_>, Self::Error>

Connect to a remote socket

Auto Trait Implementations§

§

impl Freeze for Stack

§

impl RefUnwindSafe for Stack

§

impl Send for Stack

§

impl Sync for Stack

§

impl Unpin for Stack

§

impl UnsafeUnpin 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.