#[repr(u8)]pub enum BlockOpcode {
Read = 1,
Write = 2,
Flush = 3,
Trim = 4,
CloseVmo = 5,
}
Variants§
Read = 1
Performs a regular data read or write from the device. The operation may be cached internally.
Write = 2
Flush = 3
Write any controller or device cached data to nonvolatile storage.
Trim = 4
Instructs the device to invalidate a number of blocks, making them usable for storing something else. This is basically a “delete” optimization, where the device is in charge of discarding the old content without clients having to write a given pattern. The operation may be cached internally.
CloseVmo = 5
Detaches the VMO from the block device.
Implementations§
Source§impl BlockOpcode
impl BlockOpcode
pub fn from_primitive(prim: u8) -> Option<Self>
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
👎Deprecated: Strict enums should not use
is_unknown
Trait Implementations§
Source§impl Clone for BlockOpcode
impl Clone for BlockOpcode
Source§fn clone(&self) -> BlockOpcode
fn clone(&self) -> BlockOpcode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BlockOpcode
impl Debug for BlockOpcode
Source§impl<D: ResourceDialect> Decode<BlockOpcode, D> for BlockOpcode
impl<D: ResourceDialect> Decode<BlockOpcode, D> for BlockOpcode
Source§impl<D: ResourceDialect> Encode<BlockOpcode, D> for BlockOpcode
impl<D: ResourceDialect> Encode<BlockOpcode, D> for BlockOpcode
Source§impl Hash for BlockOpcode
impl Hash for BlockOpcode
Source§impl Ord for BlockOpcode
impl Ord for BlockOpcode
Source§fn cmp(&self, other: &BlockOpcode) -> Ordering
fn cmp(&self, other: &BlockOpcode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BlockOpcode
impl PartialEq for BlockOpcode
Source§impl PartialOrd for BlockOpcode
impl PartialOrd for BlockOpcode
Source§impl TypeMarker for BlockOpcode
impl TypeMarker for BlockOpcode
Source§type Owned = BlockOpcode
type Owned = BlockOpcode
The owned Rust type which this FIDL type decodes into.
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for BlockOpcode
impl ValueTypeMarker for BlockOpcode
Source§type Borrowed<'a> = BlockOpcode
type Borrowed<'a> = BlockOpcode
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for BlockOpcode
impl Eq for BlockOpcode
impl StructuralPartialEq for BlockOpcode
Auto Trait Implementations§
impl Freeze for BlockOpcode
impl RefUnwindSafe for BlockOpcode
impl Send for BlockOpcode
impl Sync for BlockOpcode
impl Unpin for BlockOpcode
impl UnwindSafe for BlockOpcode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)