pub struct Handle<'mapper, S, E>{ /* private fields */ }
Expand description
A page in the process of being remapped.
This reference allows updating page table flags prior to committing changes.
Implementations§
Source§impl<'mapper, S, E> Handle<'mapper, S, E>
impl<'mapper, S, E> Handle<'mapper, S, E>
pub fn new(page: Page<VAddr, S>, entry: &'mapper mut E) -> Handle<'mapper, S, E>
Sourcepub fn virt_page(&self) -> &Page<VAddr, S>
pub fn virt_page(&self) -> &Page<VAddr, S>
Returns the virtual page this entry is currently mapped to.
Sourcepub unsafe fn set_writable(self, writable: bool) -> Handle<'mapper, S, E>
pub unsafe fn set_writable(self, writable: bool) -> Handle<'mapper, S, E>
Set whether or not this page is writable.
§Safety
Manual control of page flags can be used to violate Rust invariants.
Using set_writable
to make memory that the Rust compiler expects to be
read-only may cause undefined behavior. Making a page which is aliased
page table (i.e. it has multiple page table entries pointing to it) may
also cause undefined behavior.
Sourcepub unsafe fn set_executable(self, executable: bool) -> Handle<'mapper, S, E>
pub unsafe fn set_executable(self, executable: bool) -> Handle<'mapper, S, E>
Set whether or not this page is executable.
§Safety
Manual control of page flags can be used to violate Rust invariants.
Using set_executable
to make writable memory executable may cause
undefined behavior. Also, this can be used to execute the contents of
arbitrary memory, which (of course) is wildly unsafe.
Sourcepub unsafe fn set_present(self, present: bool) -> Handle<'mapper, S, E>
pub unsafe fn set_present(self, present: bool) -> Handle<'mapper, S, E>
Set whether or not this page is present.
§Safety
Manual control of page flags can be used to violate Rust invariants.
pub fn is_writable(&self) -> bool
pub fn is_executable(&self) -> bool
pub fn is_present(&self) -> bool
pub fn commit(self) -> Page<VAddr, S>
Trait Implementations§
Auto Trait Implementations§
impl<'mapper, S, E> Freeze for Handle<'mapper, S, E>where
S: Freeze,
impl<'mapper, S, E> RefUnwindSafe for Handle<'mapper, S, E>where
E: RefUnwindSafe,
S: RefUnwindSafe,
impl<'mapper, S, E> Send for Handle<'mapper, S, E>
impl<'mapper, S, E> Sync for Handle<'mapper, S, E>
impl<'mapper, S, E> Unpin for Handle<'mapper, S, E>where
S: Unpin,
impl<'mapper, S, E> !UnwindSafe for Handle<'mapper, S, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.