pub struct PageTableEntry(_);
Expand description

A page table entry, which is a u64 value under the hood.

It contains a the physical address of the Frame being mapped by this entry and the access bits (encoded PteFlags) that describes how it’s mapped, e.g., readable, writable, no exec, etc.

There isn’t and shouldn’t be any way to create/instantiate a new PageTableEntry directly. You can only obtain a reference to an PageTableEntry by going through a page table’s Table struct itself.


Returns true if this entry is unused, i.e., cleared/zeroed out.

Zeroes out this entry, setting it as “unused”.

Removes the mapping represented by this page table entry.

If the frame(s) pointed to by this entry were mapped exlusively, i.e., owned by this entry and not mapped anywhere else by any other entries, then this function returns those frames. This is useful because those returned frames can then be safely deallocated.

Returns this PageTableEntry’s flags.

Returns the physical Frame pointed to (mapped by) this PageTableEntry. If this page table entry is not PRESENT, this returns None.


pub fn set_entry(&mut self, frame: AllocatedFrame<'_>, flags: PteFlagsArch)

Sets this PageTableEntry to map the given frame with the given flags.

This is the actual mapping action that informs the MMU of a new mapping.

Note: this performs no checks about the current value of this page table entry.

Sets the flags components of this PageTableEntry to new_flags.

This does not modify the frame part of the page table entry.

Trait Implementations§

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.