Struct NotificationData

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

Notification Data.

Implementations§

Source§

impl NotificationData

Source

pub const fn new() -> Self

Creates a new default initialized bitfield.

Source

pub const fn from_bits(bits: le32) -> Self

Convert from bits.

Source

pub const fn into_bits(self) -> le32

Convert into bits.

Source

pub const fn vqn(&self) -> u16

VQ number to be notified.

Bits: 0..16

Source

pub const fn with_vqn_checked(self, value: u16) -> Result<Self, ()>

VQ number to be notified.

Bits: 0..16

Source

pub const fn with_vqn(self, value: u16) -> Self

VQ number to be notified.

Bits: 0..16

Source

pub fn set_vqn(&mut self, value: u16)

VQ number to be notified.

Bits: 0..16

Source

pub fn set_vqn_checked(&mut self, value: u16) -> Result<(), ()>

VQ number to be notified.

Bits: 0..16

Source

pub const fn next_off(&self) -> u16

Offset within the ring where the next available ring entry will be written. When VIRTIO_F_RING_PACKED has not been negotiated this refers to the 15 least significant bits of the available index. When VIRTIO_F_RING_PACKED has been negotiated this refers to the offset (in units of descriptor entries) within the descriptor ring where the next available descriptor will be written.

Bits: 16..31

Source

pub const fn with_next_off_checked(self, value: u16) -> Result<Self, ()>

Offset within the ring where the next available ring entry will be written. When VIRTIO_F_RING_PACKED has not been negotiated this refers to the 15 least significant bits of the available index. When VIRTIO_F_RING_PACKED has been negotiated this refers to the offset (in units of descriptor entries) within the descriptor ring where the next available descriptor will be written.

Bits: 16..31

Source

pub const fn with_next_off(self, value: u16) -> Self

Offset within the ring where the next available ring entry will be written. When VIRTIO_F_RING_PACKED has not been negotiated this refers to the 15 least significant bits of the available index. When VIRTIO_F_RING_PACKED has been negotiated this refers to the offset (in units of descriptor entries) within the descriptor ring where the next available descriptor will be written.

Bits: 16..31

Source

pub fn set_next_off(&mut self, value: u16)

Offset within the ring where the next available ring entry will be written. When VIRTIO_F_RING_PACKED has not been negotiated this refers to the 15 least significant bits of the available index. When VIRTIO_F_RING_PACKED has been negotiated this refers to the offset (in units of descriptor entries) within the descriptor ring where the next available descriptor will be written.

Bits: 16..31

Source

pub fn set_next_off_checked(&mut self, value: u16) -> Result<(), ()>

Offset within the ring where the next available ring entry will be written. When VIRTIO_F_RING_PACKED has not been negotiated this refers to the 15 least significant bits of the available index. When VIRTIO_F_RING_PACKED has been negotiated this refers to the offset (in units of descriptor entries) within the descriptor ring where the next available descriptor will be written.

Bits: 16..31

Source

pub const fn next_wrap(&self) -> u8

Wrap Counter. With VIRTIO_F_RING_PACKED this is the wrap counter referring to the next available descriptor. Without VIRTIO_F_RING_PACKED this is the most significant bit (bit 15) of the available index.

Bits: 31..32

Source

pub const fn with_next_wrap_checked(self, value: u8) -> Result<Self, ()>

Wrap Counter. With VIRTIO_F_RING_PACKED this is the wrap counter referring to the next available descriptor. Without VIRTIO_F_RING_PACKED this is the most significant bit (bit 15) of the available index.

Bits: 31..32

Source

pub const fn with_next_wrap(self, value: u8) -> Self

Wrap Counter. With VIRTIO_F_RING_PACKED this is the wrap counter referring to the next available descriptor. Without VIRTIO_F_RING_PACKED this is the most significant bit (bit 15) of the available index.

Bits: 31..32

Source

pub fn set_next_wrap(&mut self, value: u8)

Wrap Counter. With VIRTIO_F_RING_PACKED this is the wrap counter referring to the next available descriptor. Without VIRTIO_F_RING_PACKED this is the most significant bit (bit 15) of the available index.

Bits: 31..32

Source

pub fn set_next_wrap_checked(&mut self, value: u8) -> Result<(), ()>

Wrap Counter. With VIRTIO_F_RING_PACKED this is the wrap counter referring to the next available descriptor. Without VIRTIO_F_RING_PACKED this is the most significant bit (bit 15) of the available index.

Bits: 31..32

Source§

impl NotificationData

Source

pub const fn next_idx(&self) -> u16

Available index

This collides with Self::next_off and Self::next_wrap.

Bits: 16..32

Source

pub const fn with_next_idx(self, value: u16) -> Self

Available index

This collides with Self::with_next_off and Self::with_next_wrap.

Bits: 16..32

Source

pub fn set_next_idx(&mut self, value: u16)

Available index

This collides with Self::set_next_off and Self::set_next_wrap.

Bits: 16..32

Trait Implementations§

Source§

impl Clone for NotificationData

Source§

fn clone(&self) -> NotificationData

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NotificationData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NotificationData

Source§

fn default() -> Self

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

impl From<Le<u32>> for NotificationData

Source§

fn from(v: le32) -> Self

Converts to this type from the input type.
Source§

impl From<NotificationData> for le32

Source§

fn from(v: NotificationData) -> le32

Converts to this type from the input type.
Source§

impl Copy for NotificationData

Auto Trait Implementations§

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