Struct MemoryArea

Source
pub struct MemoryArea<B: MappingBackend> { /* private fields */ }
Expand description

A memory area represents a continuous range of virtual memory with the same flags.

The target physical memory frames are determined by MappingBackend and may not be contiguous.

Implementations§

Source§

impl<B: MappingBackend> MemoryArea<B>

Source

pub fn new(start: B::Addr, size: usize, flags: B::Flags, backend: B) -> Self

Creates a new memory area.

§Panics

Panics if start + size overflows.

Source

pub const fn va_range(&self) -> AddrRange<B::Addr>

Returns the virtual address range.

Source

pub const fn flags(&self) -> B::Flags

Returns the memory flags, e.g., the permission bits.

Source

pub const fn start(&self) -> B::Addr

Returns the start address of the memory area.

Source

pub const fn end(&self) -> B::Addr

Returns the end address of the memory area.

Source

pub fn size(&self) -> usize

Returns the size of the memory area.

Source

pub const fn backend(&self) -> &B

Returns the mapping backend of the memory area.

Trait Implementations§

Source§

impl<B: MappingBackend> Debug for MemoryArea<B>
where B::Addr: Debug, B::Flags: Debug + Copy,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B> Freeze for MemoryArea<B>

§

impl<B> RefUnwindSafe for MemoryArea<B>

§

impl<B> Send for MemoryArea<B>
where <B as MappingBackend>::Flags: Send, B: Send, <B as MappingBackend>::Addr: Send,

§

impl<B> Sync for MemoryArea<B>
where <B as MappingBackend>::Flags: Sync, B: Sync, <B as MappingBackend>::Addr: Sync,

§

impl<B> Unpin for MemoryArea<B>
where <B as MappingBackend>::Flags: Unpin, B: Unpin, <B as MappingBackend>::Addr: Unpin,

§

impl<B> UnwindSafe for MemoryArea<B>

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.