pub trait Error: Debug + Display {
// Provided methods
fn source(&self) -> Option<&(dyn Error + 'static)> { ... }
fn type_id(&self, _: Internal) -> TypeId
where Self: 'static { ... }
}Expand description
Error is a trait representing the basic expectations for error values,
i.e., values of type E in Result<T, E>.
This is essentially a re-implementation of the Rust standard library’s
std::error::Error trait. Because we cannot use std in the kernel, we
must reimplement that trait in mycelium_util.
Errors must describe themselves through the Display and Debug traits,
and may provide cause chain information:
The source method is generally used when errors cross “abstraction
boundaries”. If one module must report an error that is caused by an error
from a lower-level module, it can allow access to that error via the
source method. This makes it possible for the high-level module to
provide its own errors while also revealing some of the implementation for
debugging via source chains.
Provided Methods§
Implementations§
Source§impl dyn Error + Send + 'static
impl dyn Error + Send + 'static
Sourcepub fn is<T: Error + 'static>(&self) -> bool
pub fn is<T: Error + 'static>(&self) -> bool
Forwards to the method defined on the type dyn Error.
Sourcepub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T>
Forwards to the method defined on the type dyn Error.
Sourcepub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T>
Forwards to the method defined on the type dyn Error.
Source§impl dyn Error + Send + Sync + 'static
impl dyn Error + Send + Sync + 'static
Sourcepub fn is<T: Error + 'static>(&self) -> bool
pub fn is<T: Error + 'static>(&self) -> bool
Forwards to the method defined on the type dyn Error.
Sourcepub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T>
Forwards to the method defined on the type dyn Error.
Sourcepub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T>
Forwards to the method defined on the type dyn Error.
Source§impl dyn Error
impl dyn Error
Sourcepub fn iter_chain(&self) -> ErrorIter<'_> ⓘ
pub fn iter_chain(&self) -> ErrorIter<'_> ⓘ
Returns an iterator starting with the current error and continuing with
recursively calling source.
Source§impl dyn Error + 'static
impl dyn Error + 'static
Sourcepub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T>
Returns some reference to the boxed value if it is of type T, or
None if it isn’t.
Sourcepub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T>
Returns some mutable reference to the boxed value if it is of type T, or
None if it isn’t.