Struct flipperzero_sys::furi::Status
source · #[repr(transparent)]pub struct Status(pub i32);Expand description
Operation status.
The Furi API switches between using enum FuriStatus, int32_t and uint32_t.
Since these all use the same bit representation, we can just “cast” the returns to this type.
Tuple Fields§
§0: i32Implementations§
source§impl Status
impl Status
sourcepub const ERR: Status = _
pub const ERR: Status = _
Unspecified RTOS error: run-time error but no other error message fits.
sourcepub const ERR_TIMEOUT: Status = _
pub const ERR_TIMEOUT: Status = _
Operation not completed within the timeout period.
sourcepub const ERR_RESOURCE: Status = _
pub const ERR_RESOURCE: Status = _
Resource not available.
sourcepub const ERR_PARAMETER: Status = _
pub const ERR_PARAMETER: Status = _
Parameter error.
sourcepub const ERR_NO_MEMORY: Status = _
pub const ERR_NO_MEMORY: Status = _
System is out of memory: it was impossible to allocate or reserve memory for the operation.
sourcepub const ERR_ISR: Status = _
pub const ERR_ISR: Status = _
Not allowed in ISR context: the function cannot be called from interrupt service routines.
sourcepub fn description(self) -> &'static str
pub fn description(self) -> &'static str
Describes the status result of the operation.
sourcepub fn err_or<T>(self, ok: T) -> Result<T, Self>
pub fn err_or<T>(self, ok: T) -> Result<T, Self>
Returns Err(Status) if Status is an error, otherwise Ok(ok).
sourcepub fn err_or_else<T>(self, or_else: impl Fn(Self) -> T) -> Result<T, Self>
pub fn err_or_else<T>(self, or_else: impl Fn(Self) -> T) -> Result<T, Self>
Returns Err(Status) if Status is an error, otherwise Ok(or_else(Status)).