Skip to main content

RawBind

Trait RawBind 

Source
pub trait RawBind {
    type Error: Error;
    type Socket<'a>: RawReceive<Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error> + RawSend + RawSplit + Readable
       where Self: 'a;

    // Required method
    async fn bind(&self) -> Result<Self::Socket<'_>, Self::Error>;
}
Expand description

Re-export the edge-nal crate This trait is implemented by raw socket stacks. The trait allows the underlying driver to construct multiple connections that implement the raw socket traits

Required Associated Types§

Source

type Error: Error

Error type returned on socket creation failure

Source

type Socket<'a>: RawReceive<Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error> + RawSend + RawSplit + Readable where Self: 'a

The socket type returned by the stack

Required Methods§

Source

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

Create a raw socket

On most operating systems, creating a raw socket requires admin privileges.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> RawBind for &T
where T: RawBind,

Source§

type Error = <T as RawBind>::Error

Source§

type Socket<'a> = <T as RawBind>::Socket<'a> where &T: 'a

Source§

async fn bind( &self, ) -> Result<<&T as RawBind>::Socket<'_>, <&T as RawBind>::Error>

Source§

impl<T> RawBind for &mut T
where T: RawBind,

Source§

type Error = <T as RawBind>::Error

Source§

type Socket<'a> = <T as RawBind>::Socket<'a> where &mut T: 'a

Source§

async fn bind( &self, ) -> Result<<&mut T as RawBind>::Socket<'_>, <&mut T as RawBind>::Error>

Implementors§