Skip to main content

PointToPoint

Struct PointToPoint 

Source
pub struct PointToPoint<L> { /* private fields */ }
Expand description

A point-to-point network layer that forwards directly to a datalink.

Implementations§

Source§

impl<L> PointToPoint<L>

Source

pub fn new(link: L) -> Self

Wraps a datalink in a point-to-point network layer.

Source

pub fn into_inner(self) -> L

Consumes the wrapper and returns the inner datalink.

Trait Implementations§

Source§

impl<L: DatalinkRead> NetworkRead for PointToPoint<L>

Source§

type Error = <L as DatalinkRead>::Error

Error type for read operations.
Source§

async fn read(&mut self, buffer: &mut [u8]) -> Result<usize, Self::Error>

Reads a packet into the provided buffer, returning its length.
Source§

impl<L: DatalinkWrite> NetworkWrite for PointToPoint<L>

Source§

type Error = <L as DatalinkWrite>::Error

Error type for write operations.
Source§

async fn write(&mut self, data: &[u8]) -> Result<(), Self::Error>

Writes a packet to the network.

Auto Trait Implementations§

§

impl<L> Freeze for PointToPoint<L>
where L: Freeze,

§

impl<L> RefUnwindSafe for PointToPoint<L>
where L: RefUnwindSafe,

§

impl<L> Send for PointToPoint<L>
where L: Send,

§

impl<L> Sync for PointToPoint<L>
where L: Sync,

§

impl<L> Unpin for PointToPoint<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for PointToPoint<L>
where L: UnsafeUnpin,

§

impl<L> UnwindSafe for PointToPoint<L>
where L: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.