pub struct BackendError { /* private fields */ }Expand description
Backend error with a stable class and lossless chip-specific context.
Chip backends construct this value explicitly instead of exposing their private error enums through the portable API. The fixed-size diagnostic context remains allocation-free and contains no arbitrary backend text.
Implementations§
Source§impl BackendError
impl BackendError
Sourcepub const fn diagnostic(self) -> Diagnostic
pub const fn diagnostic(self) -> Diagnostic
Convert this backend error into the stable diagnostic schema.
Source§impl BackendError
impl BackendError
Sourcepub const fn new(class: BackendErrorClass, code: u32) -> Self
pub const fn new(class: BackendErrorClass, code: u32) -> Self
Create an error with a stable class and lossless backend code.
Sourcepub const fn class(self) -> BackendErrorClass
pub const fn class(self) -> BackendErrorClass
Stable backend failure class.
Sourcepub const fn with_stage(self, stage: DiagnosticStage) -> Self
pub const fn with_stage(self, stage: DiagnosticStage) -> Self
Attach the protocol stage known by the backend.
Sourcepub const fn with_profile_revision(self, revision: &'static str) -> Self
pub const fn with_profile_revision(self, revision: &'static str) -> Self
Attach the immutable backend/profile revision used by this firmware.
Sourcepub fn with_trace(self, kind: DiagnosticTraceKind, value: u32) -> Self
pub fn with_trace(self, kind: DiagnosticTraceKind, value: u32) -> Self
Append one bounded numeric trace entry.
Trait Implementations§
Source§impl Clone for BackendError
impl Clone for BackendError
Source§fn clone(&self) -> BackendError
fn clone(&self) -> BackendError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BackendError
Source§impl Debug for BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
impl Eq for BackendError
Source§impl PartialEq for BackendError
impl PartialEq for BackendError
impl StructuralPartialEq for BackendError
Auto Trait Implementations§
impl Freeze for BackendError
impl RefUnwindSafe for BackendError
impl Send for BackendError
impl Sync for BackendError
impl Unpin for BackendError
impl UnsafeUnpin for BackendError
impl UnwindSafe for BackendError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more