Skip to main content

CopyToWalker

Struct CopyToWalker 

Source
pub struct CopyToWalker<'a, PTE, Mapper, Error>
where PTE: FromPrimitive + PrimInt + Unsigned, Mapper: PageTableMapper<PTE, Error>,
{ pub mapper: &'a mut Mapper, pub offset: usize, pub data: &'a [u8], pub format: &'a PageFormat<'a, PTE>, pub error: PhantomData<Error>, }
Expand description

The CopyToWalker struct is an implementation of a crate::walker::PageWalker used to copy data to a given a virtual address range.

This is used by the AddressSpace::copy_to method.

Fields§

§mapper: &'a mut Mapper

The page table mapper.

§offset: usize

The offset within the buffer.

§data: &'a [u8]

Storage for the data to copy.

§format: &'a PageFormat<'a, PTE>

The page format.

§error: PhantomData<Error>

A marker for Error.

Trait Implementations§

Source§

impl<'a, PTE, Mapper, Error> PageWalker<PTE, Error> for CopyToWalker<'a, PTE, Mapper, Error>
where PTE: FromPrimitive + PrimInt + Unsigned, Mapper: PageTableMapper<PTE, Error>,

Source§

fn read_pte(&self, phys_addr: PTE) -> Result<PTE, Error>

Reads the PTE at the given physical address.

Source§

fn handle_pte( &mut self, pte_type: PteType, range: Range<usize>, pte: &PTE, ) -> Result<(), Error>

Maps the page and copies the data from the buffer.

Source§

fn handle_pte_hole( &mut self, _level: usize, _range: Range<usize>, _pte: &PTE, ) -> Result<(), Error>

This callback handles a PTE hole, i.e. a PTE that is not marked as present, and is given the level, the virtual address range and an immutable reference to the PTE. The implementation of this callback is optional.
Source§

fn handle_post_pte( &mut self, _level: usize, _range: Range<usize>, _pte: &PTE, ) -> Result<(), Error>

This callback handles the PTE of a page table after recursing the page table hierarchy, and is given the level, the virtual address and an immutable reference to the PTE. The implementation of this callback is optional.

Auto Trait Implementations§

§

impl<'a, PTE, Mapper, Error> Freeze for CopyToWalker<'a, PTE, Mapper, Error>

§

impl<'a, PTE, Mapper, Error> RefUnwindSafe for CopyToWalker<'a, PTE, Mapper, Error>
where Mapper: RefUnwindSafe, Error: RefUnwindSafe, PTE: RefUnwindSafe,

§

impl<'a, PTE, Mapper, Error> Send for CopyToWalker<'a, PTE, Mapper, Error>
where Mapper: Send, Error: Send, PTE: Sync,

§

impl<'a, PTE, Mapper, Error> Sync for CopyToWalker<'a, PTE, Mapper, Error>
where Mapper: Sync, Error: Sync, PTE: Sync,

§

impl<'a, PTE, Mapper, Error> Unpin for CopyToWalker<'a, PTE, Mapper, Error>
where Error: Unpin,

§

impl<'a, PTE, Mapper, Error> UnsafeUnpin for CopyToWalker<'a, PTE, Mapper, Error>

§

impl<'a, PTE, Mapper, Error> !UnwindSafe for CopyToWalker<'a, PTE, Mapper, Error>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.