Struct esp_idf_sys::EspError
source · [−]#[repr(transparent)]pub struct EspError(_);
Expand description
Implementations
sourceimpl EspError
impl EspError
sourcepub const fn from_non_zero(error: NonZeroI32) -> Self
pub const fn from_non_zero(error: NonZeroI32) -> Self
Wrap a [NonZeroI32
]. Since ESP_OK
is 0, this can never fail;
sourcepub const fn from_infallible<const E: esp_err_t>() -> Self
pub const fn from_infallible<const E: esp_err_t>() -> Self
sourcepub fn check_and_return<T>(error: esp_err_t, value: T) -> Result<T, Self>
pub fn check_and_return<T>(error: esp_err_t, value: T) -> Result<T, Self>
Convert error
into a [Result
] with Ok(value)
if no error occurred.
If error
is ESP_OK
return [Ok
] of value
otherwise return [Err
] of
wrapped error
.
Trait Implementations
sourceimpl Error for EspError
impl Error for EspError
1.30.0fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0fn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
1.0.0fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎 Deprecated since 1.33.0:
replaced by Error::source, which can support downcasting
sourceimpl Hash for EspError
impl Hash for EspError
sourcefn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
1.3.0fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Copy for EspError
impl Eq for EspError
impl StructuralEq for EspError
impl StructuralPartialEq for EspError
Auto Trait Implementations
impl RefUnwindSafe for EspError
impl Send for EspError
impl Sync for EspError
impl Unpin for EspError
impl UnwindSafe for EspError
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more