Skip to main content

DynPmm

Struct DynPmm 

Source
pub struct DynPmm<'a, const RAM: bool> { /* private fields */ }
Available on crate feature full only.
Expand description

A type erased reference to a Pmm.

This is equivalent to &dyn Pmm with the addition that a DynPmm<true> can be converted directly to a DynPmm<false> by calling from or into.

Implementations§

Source§

impl<'a, const RAM: bool> DynPmm<'a, RAM>

Source

pub const fn into(self) -> DynPmm<'a, false>

Converts to a DynPmm<false>.

Source

pub fn allocate_one(&self) -> Result<Frames<RAM>, AllocError>
where Self: 'static,

Allocates a single owned frame.

§Errors

Returns an AllocError if the memory could not be allocated.

Source

pub fn allocate(&self, count: NonZero<usize>) -> Result<Frames<RAM>, AllocError>
where Self: 'static,

Allocates counts number of contiguous owned Frames.

§Errors

Returns an AllocError if the memory could not be allocated. This does not mean there is no free memory, just that is there no region of contiguous memory large enough.

Source

pub fn allocate_at( &self, at: RawFrame, count: NonZero<usize>, ) -> Result<Frames<RAM>, AllocError>
where Self: 'static,

Allocates count number of contiguous owned Frames with the first frame being at at.

§Errors

Returns an AllocError if the memory could not be allocated. This does not mean there is no free memory, just that is there no region of contiguous memory large enough starting at at.

Trait Implementations§

Source§

impl<'a, const RAM: bool> Clone for DynPmm<'a, RAM>

Source§

fn clone(&self) -> DynPmm<'a, RAM>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, const RAM: bool> Copy for DynPmm<'a, RAM>

Source§

impl<'a, const RAM: bool> Debug for DynPmm<'a, RAM>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a, const RAM: bool, T: Pmm<RAM>> From<&'a T> for DynPmm<'a, RAM>

Source§

fn from(value: &'a T) -> Self

Converts to this type from the input type.
Source§

impl<const RAM: bool> Pmm<RAM> for DynPmm<'_, RAM>

Source§

fn allocate_one_raw(&self) -> Result<RawFrame, AllocError>

Allocates a single frame. Read more
Source§

fn allocate_raw(&self, count: NonZero<usize>) -> Result<RawFrame, AllocError>

Allocates count number of contiguous frames. Read more
Source§

fn allocate_raw_at( &self, at: RawFrame, count: NonZero<usize>, ) -> Result<RawFrame, AllocError>

Allocates count number of contiguous frames with the first frame being at at. Read more
Source§

unsafe fn deallocate_raw(&self, base: RawFrame, count: NonZero<usize>)

Deallocates count frames starting at base. Read more
Source§

impl<const RAM: bool> Send for DynPmm<'_, RAM>

Source§

impl<const RAM: bool> Sync for DynPmm<'_, RAM>

Auto Trait Implementations§

§

impl<'a, const RAM: bool> Freeze for DynPmm<'a, RAM>

§

impl<'a, const RAM: bool> RefUnwindSafe for DynPmm<'a, RAM>

§

impl<'a, const RAM: bool> Unpin for DynPmm<'a, RAM>

§

impl<'a, const RAM: bool> UnsafeUnpin for DynPmm<'a, RAM>

§

impl<'a, const RAM: bool> UnwindSafe for DynPmm<'a, RAM>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.