pub struct ErrorContext {
pub form_name: Option<String>,
pub field_name: Option<String>,
pub operation: Option<String>,
pub timestamp: Option<DateTime<Utc>>,
pub user_agent: Option<String>,
pub additional_data: HashMap<String, String>,
}Expand description
Error context for additional debugging information
Fieldsยง
ยงform_name: Option<String>ยงfield_name: Option<String>ยงoperation: Option<String>ยงtimestamp: Option<DateTime<Utc>>ยงuser_agent: Option<String>ยงadditional_data: HashMap<String, String>Implementationsยง
Sourceยงimpl ErrorContext
impl ErrorContext
Sourcepub fn with_form_name(self, form_name: impl Into<String>) -> Self
pub fn with_form_name(self, form_name: impl Into<String>) -> Self
Set the form name
Sourcepub fn with_field_name(self, field_name: impl Into<String>) -> Self
pub fn with_field_name(self, field_name: impl Into<String>) -> Self
Set the field name
Sourcepub fn with_operation(self, operation: impl Into<String>) -> Self
pub fn with_operation(self, operation: impl Into<String>) -> Self
Set the operation
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Set the user agent
Sourcepub fn with_data(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_data(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add additional data
Sourcepub fn field_name(&self) -> Option<&str>
pub fn field_name(&self) -> Option<&str>
Get the field name
Sourcepub fn user_agent(&self) -> Option<&str>
pub fn user_agent(&self) -> Option<&str>
Get the user agent
Sourcepub fn has_form_name(&self) -> bool
pub fn has_form_name(&self) -> bool
Check if context has form name
Sourcepub fn has_field_name(&self) -> bool
pub fn has_field_name(&self) -> bool
Check if context has field name
Sourcepub fn has_operation(&self) -> bool
pub fn has_operation(&self) -> bool
Check if context has operation
Sourcepub fn has_timestamp(&self) -> bool
pub fn has_timestamp(&self) -> bool
Check if context has timestamp
Sourcepub fn has_user_agent(&self) -> bool
pub fn has_user_agent(&self) -> bool
Check if context has user agent
Sourcepub fn has_additional_data(&self) -> bool
pub fn has_additional_data(&self) -> bool
Check if context has additional data
Sourcepub fn additional_data_count(&self) -> usize
pub fn additional_data_count(&self) -> usize
Get the number of additional data entries
Sourcepub fn clear_additional_data(&mut self)
pub fn clear_additional_data(&mut self)
Clear all additional data
Sourcepub fn remove_data(&mut self, key: &str) -> Option<String>
pub fn remove_data(&mut self, key: &str) -> Option<String>
Remove a specific data entry
Sourcepub fn update_timestamp(&mut self)
pub fn update_timestamp(&mut self)
Update timestamp to current time
Sourcepub fn for_operation(operation: impl Into<String>) -> Self
pub fn for_operation(operation: impl Into<String>) -> Self
Create a context for a specific operation
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 (const: unstable) ยท 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
Sourceยงimpl Default for ErrorContext
impl Default 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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<T> SerializableKey for T
impl<T> SerializableKey for T
Sourceยงimpl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Sourceยงfn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Sourceยงfn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.