pub struct Pages { /* private fields */ }
Expand description
Represents a page, or range of pages with Immutable
accessibility
Implementations§
Source§impl Pages
impl Pages
Sourcepub fn try_into_mutable(self) -> Result<MutPages, IntoPagesError<Self>>
pub fn try_into_mutable(self) -> Result<MutPages, IntoPagesError<Self>>
Source§impl Pages
impl Pages
Sourcepub fn set_locked(&mut self, locked: bool) -> Result<()>
pub fn set_locked(&mut self, locked: bool) -> Result<()>
Sourcepub fn join<const C: usize>(
parts: [PagesType; C],
) -> Result<Self, JoinError<[PagesType; C]>>
pub fn join<const C: usize>( parts: [PagesType; C], ) -> Result<Self, JoinError<[PagesType; C]>>
Joins two or more contiguous pages from the same allocation into a single object, updating the protection of the memory region in a single syscall if nessassary.
§Errors
See JoinErrorKind
docs. Will return a JoinError
containing the input PagesType
s and a JoinErrorKind
containing what went wrong.
Sourcepub fn join_vec(
parts: Vec<PagesType>,
) -> Result<Self, JoinError<Vec<PagesType>>>
pub fn join_vec( parts: Vec<PagesType>, ) -> Result<Self, JoinError<Vec<PagesType>>>
Joins two or more contiguous pages from the same allocation into a single object,
updating the protection of the memory region in a single syscall if nessassary.
Accepts a Vec as an input rather than a const size array like Self::join
§Errors
See JoinErrorKind
docs. Will return a JoinError
containing the input PagesType
s and a JoinErrorKind
containing what went wrong.
Sourcepub fn try_into_allocation(self) -> Result<Allocation, Self>
pub fn try_into_allocation(self) -> Result<Allocation, Self>
Converts this Pages
into an Allocation
.
If the only reference that still exists to pages inside the allocation is through
self
, then this will succeed.
Other references can be removed by dropping other pages objects or by joining them
together through Self::join
or Self::join_vec
.
§Errors
Will return Self
as an error if other references to the allocation still exist.
Source§impl Pages
impl Pages
Sourcepub fn try_into_inaccessible(
self,
) -> Result<InaccessiblePages, IntoPagesError<Self>>
pub fn try_into_inaccessible( self, ) -> Result<InaccessiblePages, IntoPagesError<Self>>
Converts this InaccessiblePages
into Pages
, updating the protection of the underlying pages
§Errors
Will error if protecting the pages fails, error object contains self.
Trait Implementations§
Source§impl AnyPages for Pages
impl AnyPages for Pages
Source§fn start(&self) -> usize
fn start(&self) -> usize
Source§fn end(&self) -> usize
fn end(&self) -> usize
Source§fn accessibility(&self) -> Accessibility
fn accessibility(&self) -> Accessibility
Accessibility
of this pages objectSource§fn allocation(&self) -> &Allocation
fn allocation(&self) -> &Allocation
Allocation
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
&dyn Any
object for reference downcastingSource§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any
object for reference downcastingSource§fn into_pages_type(self) -> PagesType
fn into_pages_type(self) -> PagesType
PagesType
enum to allow pattern matching and unwrapping on accessibilitySource§fn len_bytes(&self) -> usize
fn len_bytes(&self) -> usize
AnyPages::pages
multiplied by the page size