pub trait AnyPages: Sealed {
// Required methods
fn start(&self) -> usize;
fn end(&self) -> usize;
fn accessibility(&self) -> Accessibility;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn into_pages_type(self) -> PagesType;
fn allocation(&self) -> &Allocation;
fn as_ptr(&self) -> *const u8;
// Provided methods
fn pages(&self) -> usize { ... }
fn len_bytes(&self) -> usize { ... }
}
Expand description
Common trait of all types of pages Note: This trait is sealed as assumptions are made about the implementors that allow properties to be safe. It would not make sense to create your own pages object which implements this trait.
Required Methods§
Sourcefn start(&self) -> usize
fn start(&self) -> usize
Gets the start index of the page of the underlying allocation which this object references
Sourcefn end(&self) -> usize
fn end(&self) -> usize
Gets the end index of the page of the underlying allocation which this object references
Sourcefn accessibility(&self) -> Accessibility
fn accessibility(&self) -> Accessibility
Gets the Accessibility
of this pages object
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Gets this pages object as a &dyn Any
object for reference downcasting
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Gets this pages object as a &mut dyn Any
object for reference downcasting
Sourcefn into_pages_type(self) -> PagesType
fn into_pages_type(self) -> PagesType
Gets this pages object as a PagesType
enum to allow pattern matching and unwrapping on accessibility
Sourcefn allocation(&self) -> &Allocation
fn allocation(&self) -> &Allocation
Gets an immutable reference to the underlying Allocation
Provided Methods§
Sourcefn len_bytes(&self) -> usize
fn len_bytes(&self) -> usize
Gets the number of bytes this pages object references. This is implemented as AnyPages::pages
multiplied by the page size