pub struct Error { /* private fields */ }Expand description
The error type for all fallible operations in edgefirst-tflite.
Error wraps a private ErrorKind enum so that the set of failure modes
can grow without breaking callers. Use the is_*() inspection methods and
Error::status_code to classify an error programmatically.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_library_error(&self) -> bool
pub fn is_library_error(&self) -> bool
Returns true if this error originated from library loading or symbol
resolution (i.e. a libloading::Error).
Sourcepub fn is_delegate_error(&self) -> bool
pub fn is_delegate_error(&self) -> bool
Returns true if the underlying TFLite status is one of the delegate
error codes: StatusCode::DelegateError,
StatusCode::DelegateDataNotFound,
StatusCode::DelegateDataWriteError, or
StatusCode::DelegateDataReadError.
Sourcepub fn is_null_pointer(&self) -> bool
pub fn is_null_pointer(&self) -> bool
Returns true if a C API call returned a null pointer.
Sourcepub fn is_invalid_argument(&self) -> bool
pub fn is_invalid_argument(&self) -> bool
Returns true if this error is an invalid-argument error.
Sourcepub fn status_code(&self) -> Option<StatusCode>
pub fn status_code(&self) -> Option<StatusCode>
Returns the TFLite StatusCode when the error originated from a
non-OK C API status, or None otherwise.
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Attach additional human-readable context to this error.
The context string is appended in parentheses when the error is displayed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()