#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.