#[non_exhaustive]
pub enum Operation {
Show 19 variants
MapFile,
MapFileHandle,
MapFileView,
MapAnonymous,
MapAnonymousHandle,
MapAnonymousView,
Unmap,
Protect,
Advise,
Lock,
Unlock,
Flush,
RingAllocate,
RingDeallocate,
RingEntry,
RingPrimary,
RingSecondary,
MemoryFd,
None,
}
Expand description
A list specifying general categories of erroneous operations.
This list is intended to grow over time and it is not recommended to exhaustively match against it.
It is used with the Error
type.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
MapFile
The operation failed while attempting to map a file.
MapFileHandle
A map file handle failed to open.
MapFileView
The view for a map file handle could not be created.
MapAnonymous
The operation failed while attempting to allocate an anonymous mapping.
MapAnonymousHandle
An anonymous mapping handle failed to open.
MapAnonymousView
The view for an anonymouse mapping handle could not be created.
Unmap
A pointer could not be unmapped.
Protect
The Protect
could not be applied to the provided memory region.
Advise
The AdviseAccess
or AdviseUsage
could not be applied to the
provided memory region.
Lock
The physical page could not be locked into memory.
Unlock
The physical page could not be unlocked from memory.
Flush
A flush cannot be perfomed for the provided input.
RingAllocate
The full address space for a ring could not be allocated.
RingDeallocate
The full address space for a ring could not be deallocated.
RingEntry
A virtual mapping entry could not be created.
RingPrimary
The mapping for the first half of the ring failed to allocate.
RingSecondary
The mapping for the second half of the ring failed to allocate.
MemoryFd
A temporary memory file descriptor failed to open.
None
Used for pure I/O errors to simplify wrapping a std::io::Error
into an
Implementations
sourceimpl Operation
impl Operation
sourcepub fn as_str(&self) -> Option<&'static str>
pub fn as_str(&self) -> Option<&'static str>
Returns a display message fragment describing the Operation
type.
The result of as_str
is used to Display
the Operation
.
Examples
use vmap::Operation;
fn print_operation(op: Operation) {
println!("failed to {}", op.as_str().unwrap());
}
// Will print "failed to map file".
print_operation(Operation::MapFile);
Trait Implementations
sourceimpl Ord for Operation
impl Ord for Operation
sourceimpl PartialOrd<Operation> for Operation
impl PartialOrd<Operation> for Operation
sourcefn partial_cmp(&self, other: &Operation) -> Option<Ordering>
fn partial_cmp(&self, other: &Operation) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Operation
impl Eq for Operation
impl StructuralEq for Operation
impl StructuralPartialEq for Operation
Auto Trait Implementations
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more