Enum BlockOpcode
#[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§
§impl BlockOpcode
impl BlockOpcode
pub fn from_primitive(prim: u8) -> Option<BlockOpcode>
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
👎Deprecated: Strict enums should not use
is_unknown
Trait Implementations§
§impl Clone for BlockOpcode
impl Clone for BlockOpcode
§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 more§impl Debug for BlockOpcode
impl Debug for BlockOpcode
§impl<D> Decode<BlockOpcode, D> for BlockOpcodewhere
D: ResourceDialect,
impl<D> Decode<BlockOpcode, D> for BlockOpcodewhere
D: ResourceDialect,
§fn new_empty() -> BlockOpcode
fn new_empty() -> BlockOpcode
Creates a valid instance of
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<BlockOpcode, D> for BlockOpcodewhere
D: ResourceDialect,
impl<D> Encode<BlockOpcode, D> for BlockOpcodewhere
D: ResourceDialect,
§impl Hash for BlockOpcode
impl Hash for BlockOpcode
§impl Ord for BlockOpcode
impl Ord for BlockOpcode
§impl PartialEq for BlockOpcode
impl PartialEq for BlockOpcode
§impl PartialOrd for BlockOpcode
impl PartialOrd for BlockOpcode
§impl TypeMarker for BlockOpcode
impl TypeMarker for BlockOpcode
§type Owned = BlockOpcode
type Owned = BlockOpcode
The owned Rust type which this FIDL type decodes into.
§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.
§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
.§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 more§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.§impl ValueTypeMarker for BlockOpcode
impl ValueTypeMarker for BlockOpcode
§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 more§fn borrow(
value: &<BlockOpcode as TypeMarker>::Owned,
) -> <BlockOpcode as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<BlockOpcode as TypeMarker>::Owned, ) -> <BlockOpcode as ValueTypeMarker>::Borrowed<'_>
Cheaply converts from
&Self::Owned
to Self::Borrowed
.impl 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