Skip to main content

VirtqueueBuffer

Enum VirtqueueBuffer 

Source
pub enum VirtqueueBuffer<'b> {
    DeviceReadable(SubSliceMutImmut<'b, u8>),
    DeviceWriteable(SubSliceMut<'b, u8>),
}
Expand description

A slice of memory to be shared with a VirtIO device, either as device-readable or device-writeable.

We can use either mutable or immutable Rust slices to expose device-readable buffers. The VirtIO Specification Version 1.3 states that, for Split Virtqueues:

A device MUST NOT write to a device-readable buffer, and a device SHOULD NOT read a device-writable buffer (it MAY do so for debugging or diagnostic purposes).

Variants§

§

DeviceReadable(SubSliceMutImmut<'b, u8>)

§

DeviceWriteable(SubSliceMut<'b, u8>)

Trait Implementations§

Source§

impl<'b> Debug for VirtqueueBuffer<'b>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'b> Freeze for VirtqueueBuffer<'b>

§

impl<'b> RefUnwindSafe for VirtqueueBuffer<'b>

§

impl<'b> Send for VirtqueueBuffer<'b>

§

impl<'b> Sync for VirtqueueBuffer<'b>

§

impl<'b> Unpin for VirtqueueBuffer<'b>

§

impl<'b> UnsafeUnpin for VirtqueueBuffer<'b>

§

impl<'b> !UnwindSafe for VirtqueueBuffer<'b>

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.