Skip to main content

RxRing

Struct RxRing 

Source
pub struct RxRing<D: RxDescriptor> { /* private fields */ }

Implementations§

Source§

impl<D: RxDescriptor> RxRing<D>

Source

pub unsafe fn new(descs: *mut D, count: usize) -> Self

§Safety

descs must point to count valid, zero-initialised descriptors.

Source

pub fn count(&self) -> usize

Performs the count operation.

Source

pub fn tail(&self) -> usize

Performs the tail operation.

Source

pub fn desc_mut(&mut self, idx: usize) -> &mut D

Performs the desc mut operation.

Source

pub fn poll(&self) -> Option<(usize, u16)>

Check the next descriptor; returns (index, packet_length) if ready.

Source

pub fn advance(&mut self) -> usize

Advance tail after consuming a packet. Returns new tail.

Source

pub fn setup_desc(&mut self, idx: usize, buf_phys: u64)

Set up one RX descriptor with a pre-allocated buffer.

Trait Implementations§

Auto Trait Implementations§

§

impl<D> Freeze for RxRing<D>

§

impl<D> RefUnwindSafe for RxRing<D>
where D: RefUnwindSafe,

§

impl<D> !Sync for RxRing<D>

§

impl<D> Unpin for RxRing<D>

§

impl<D> UnsafeUnpin for RxRing<D>

§

impl<D> UnwindSafe for RxRing<D>
where D: RefUnwindSafe,

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