#[repr(C)]pub struct Descriptor { /* private fields */ }
Expand description
A virtio packed descriptor constraints with C representation.
Implementations§
Source§impl Descriptor
impl Descriptor
Sourcepub fn addr(&self) -> GuestAddress
pub fn addr(&self) -> GuestAddress
Return the guest physical address of the descriptor buffer.
Sourcepub fn flags(&self) -> u16
pub fn flags(&self) -> u16
Return the flags for this descriptor, including next, write and indirect bits.
Sourcepub fn refers_to_indirect_table(&self) -> bool
pub fn refers_to_indirect_table(&self) -> bool
Check whether this descriptor refers to a buffer containing an indirect descriptor table.
Sourcepub fn is_write_only(&self) -> bool
pub fn is_write_only(&self) -> bool
Check if the driver designated this as a write only descriptor.
If this is false, this descriptor is read only. Write only means the the emulated device can write and the driver can read.
Source§impl Descriptor
impl Descriptor
Trait Implementations§
Source§impl ByteValued for Descriptor
impl ByteValued for Descriptor
Source§fn from_slice(data: &[u8]) -> Option<&Self>
fn from_slice(data: &[u8]) -> Option<&Self>
Converts a slice of raw data into a reference of
Self
. Read moreSource§fn from_mut_slice(data: &mut [u8]) -> Option<&mut Self>
fn from_mut_slice(data: &mut [u8]) -> Option<&mut Self>
Converts a mutable slice of raw data into a mutable reference of
Self
. Read moreSource§fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Converts a mutable reference to
self
into a mutable slice of bytes. Read moreSource§fn as_bytes(&mut self) -> VolatileSlice<'_>
fn as_bytes(&mut self) -> VolatileSlice<'_>
Converts a mutable reference to
self
into a VolatileSlice
. This is
useful because VolatileSlice
provides a Bytes<usize>
implementation. Read moreSource§impl Clone for Descriptor
impl Clone for Descriptor
Source§fn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Descriptor
impl Debug for Descriptor
Source§impl Default for Descriptor
impl Default for Descriptor
Source§fn default() -> Descriptor
fn default() -> Descriptor
Returns the “default value” for a type. Read more
Source§impl From<Descriptor> for RawDescriptor
impl From<Descriptor> for RawDescriptor
Source§fn from(desc: Descriptor) -> Self
fn from(desc: Descriptor) -> Self
Converts to this type from the input type.
Source§impl From<RawDescriptor> for Descriptor
impl From<RawDescriptor> for Descriptor
Source§fn from(desc: RawDescriptor) -> Descriptor
fn from(desc: RawDescriptor) -> Descriptor
Converts to this type from the input type.
impl Copy for Descriptor
Auto Trait Implementations§
impl Freeze for Descriptor
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnwindSafe for Descriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more