#[non_exhaustive]pub struct AllocError { /* private fields */ }Available on crate feature
full only.Expand description
The error returned when an allocation was unsuccessful.
This will include a payload about the reason for failure.
§Examples
use kernel_api::allocator::highmem;
if let Err(e) = highmem().allocate_one() {
info!("memory allocation failed: {e}");
}Implementations§
Source§impl AllocError
impl AllocError
Sourcepub const fn pmm() -> Self
pub const fn pmm() -> Self
Constructs an AllocError caused by an error in physical memory allocation.
§Examples
use kernel_api::allocator::AllocError;
let error = AllocError::pmm();Trait Implementations§
Source§impl Clone for AllocError
impl Clone for AllocError
Source§fn clone(&self) -> AllocError
fn clone(&self) -> AllocError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AllocError
Source§impl Debug for AllocError
impl Debug for AllocError
Source§impl Default for AllocError
impl Default for AllocError
Source§fn default() -> AllocError
fn default() -> AllocError
Returns the “default value” for a type. Read more
Source§impl Display for AllocError
impl Display for AllocError
impl Eq for AllocError
Source§impl Error for AllocError
impl Error for AllocError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AllocError> for MapPageError
impl From<AllocError> for MapPageError
Source§fn from(_value: AllocError) -> Self
fn from(_value: AllocError) -> Self
Converts to this type from the input type.
Source§impl From<AllocError> for Error
impl From<AllocError> for Error
Source§fn from(_: AllocError) -> Self
fn from(_: AllocError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for AllocError
impl From<Error> for AllocError
Source§impl PartialEq for AllocError
impl PartialEq for AllocError
impl StructuralPartialEq for AllocError
Auto Trait Implementations§
impl Freeze for AllocError
impl RefUnwindSafe for AllocError
impl Send for AllocError
impl Sync for AllocError
impl Unpin for AllocError
impl UnsafeUnpin for AllocError
impl UnwindSafe for AllocError
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more