pub struct Pages<const ORDER: u32> { /* private fields */ }
Expand description

A set of physical pages.

Pages holds a reference to a set of pages of order ORDER. Having the order as a generic const allows the struct to have the same size as a pointer.

Invariants

The pointer Pages::pages is valid and points to 2^ORDER pages.

Implementations

Allocates a new set of contiguous pages.

Copies data from the given UserSlicePtrReader into the pages.

Maps the pages and reads from them into the given buffer.

Safety

Callers must ensure that the destination buffer is valid for the given length. Additionally, if the raw buffer is intended to be recast, they must ensure that the data can be safely cast; crate::io_buffer::ReadableFromBytes has more details about it.

Maps the pages and writes into them from the given buffer.

Safety

Callers must ensure that the buffer is valid for the given length. Additionally, if the page is (or will be) mapped by userspace, they must ensure that no kernel data is leaked through padding if it was cast from another type; crate::io_buffer::WritableToBytes has more details about it.

Trait Implementations

Executes the destructor for this type. 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 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.
This documentation is an old archive. Please see https://rust.docs.kernel.org instead.