Struct esp_idf_sys::EspError
source · pub struct EspError(/* private fields */);
Expand description
Implementations§
source§impl 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§
source§impl Error for EspError
impl Error for EspError
1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
impl Copy for EspError
impl Eq for EspError
impl StructuralPartialEq for EspError
Auto Trait Implementations§
impl Freeze for EspError
impl RefUnwindSafe for EspError
impl Send for EspError
impl Sync for EspError
impl Unpin for EspError
impl UnwindSafe for EspError
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)