Skip to main content

Socket

Struct Socket 

Source
pub struct Socket<U: Umem> { /* private fields */ }

Implementations§

Source§

impl<U: Umem> Socket<U>

Source

pub fn new( dev_queue: DeviceQueue, umem: U, zero_copy: bool, rx_fill_ring_size: usize, rx_ring_size: usize, tx_completion_ring_size: usize, tx_ring_size: usize, ) -> Result<(Self, Rx<U::Frame>, Tx<U::Frame>), Error>

Source

pub fn tx( queue: DeviceQueue, umem: U, zero_copy: bool, completion_size: usize, ring_size: usize, ) -> Result<(Self, Tx<U::Frame>), Error>

Source

pub fn rx( queue: DeviceQueue, umem: U, zero_copy: bool, fill_size: usize, ring_size: usize, ) -> Result<(Self, Rx<U::Frame>), Error>

Source

pub fn queue(&self) -> &DeviceQueue

Source

pub fn umem(&mut self) -> &mut U

Trait Implementations§

Source§

impl<U: Umem> AsFd for Socket<U>

Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more

Auto Trait Implementations§

§

impl<U> !Sync for Socket<U>

§

impl<U> Freeze for Socket<U>
where U: Freeze,

§

impl<U> RefUnwindSafe for Socket<U>
where U: RefUnwindSafe,

§

impl<U> Send for Socket<U>
where U: Send,

§

impl<U> Unpin for Socket<U>
where U: Unpin,

§

impl<U> UnsafeUnpin for Socket<U>
where U: UnsafeUnpin,

§

impl<U> UnwindSafe for Socket<U>
where U: 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, 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.