pub struct ErrorContext {
pub location: Option<String>,
pub thread_id: Option<ThreadId>,
pub timestamp: SystemTime,
pub node_id: Option<NodeId>,
pub port_id: Option<String>,
pub parameter_id: Option<String>,
pub extras: Vec<(String, String)>,
}Expand description
Additional context for errors
This can be attached to errors to provide more information about where and why they occurred.
Fields§
§location: Option<String>Source location (file:line)
thread_id: Option<ThreadId>Thread ID where error occurred
timestamp: SystemTimeTimestamp when error occurred
node_id: Option<NodeId>Node ID (if applicable)
port_id: Option<String>Port ID (if applicable)
parameter_id: Option<String>Parameter ID (if applicable)
extras: Vec<(String, String)>Additional key-value pairs
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_location(self, file: &str, line: u32) -> Self
pub fn with_location(self, file: &str, line: u32) -> Self
Add source location
Sourcepub fn with_parameter(self, param_id: impl AsRef<str>) -> Self
pub fn with_parameter(self, param_id: impl AsRef<str>) -> Self
Add parameter ID
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§fn clone(&self) -> ErrorContext
fn clone(&self) -> ErrorContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorContext
impl Debug for ErrorContext
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnsafeUnpin for ErrorContext
impl UnwindSafe for ErrorContext
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