Struct traceback_error::TracebackError
source · pub struct TracebackError {
pub message: String,
pub file: String,
pub line: u32,
pub parent: Option<Box<TracebackError>>,
pub time_created: DateTime<Utc>,
pub extra_data: Value,
pub project: Option<String>,
pub computer: Option<String>,
pub user: Option<String>,
pub is_parent: bool,
pub is_handled: bool,
/* private fields */
}Fields§
§message: String§file: String§line: u32§parent: Option<Box<TracebackError>>§time_created: DateTime<Utc>§extra_data: Value§project: Option<String>§computer: Option<String>§user: Option<String>§is_parent: bool§is_handled: boolImplementations§
source§impl TracebackError
impl TracebackError
Cloning this may be expensive, but for now it’s fine The reason it may be expensive is because it recursively clones the parent and the parent’s parent and so on (i think) To fix this, we could make it so that each of the with_ functions consume self, and then return a new Self with the new data Very easy fix, but i am unsure if we’ll need the possibility to keep the old error Maybe make non-consuming and consuming versions?
pub fn new(message: String, file: String, line: u32) -> Self
pub fn with_parent(self, parent: TracebackError) -> Self
pub fn with_extra_data(self, extra_data: Value) -> Self
pub fn with_project(self, project: &str) -> Self
pub fn with_computer_name(self, computer: &str) -> Self
pub fn with_username(self, user: &str) -> Self
pub fn with_env_vars(self) -> Self
pub fn with_is_parent(self, is_parent: bool) -> Self
pub fn clone(&mut self) -> Self
Trait Implementations§
source§impl Clone for TracebackError
impl Clone for TracebackError
source§fn clone(&self) -> TracebackError
fn clone(&self) -> TracebackError
Returns a copy 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 TracebackError
impl Debug for TracebackError
source§impl Default for TracebackError
impl Default for TracebackError
source§impl<'de> Deserialize<'de> for TracebackError
impl<'de> Deserialize<'de> for TracebackError
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for TracebackError
impl Display for TracebackError
This display implementation is recursive, and will print the error and all its parents with a tab in front of each parent.
source§impl Drop for TracebackError
impl Drop for TracebackError
source§impl Error for TracebackError
impl Error for TracebackError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl Error for TracebackError
impl Error for TracebackError
source§fn custom<T: Display>(msg: T) -> Self
fn custom<T: Display>(msg: T) -> Self
Raised when there is general error when deserializing a type. Read more
source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize receives a type different from what it was
expecting. Read moresource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize receives a value of the right type but that
is wrong for some other reason. Read moresource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Raised when deserializing a sequence or map and the input data contains
too many or too few elements. Read more
source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize enum type received a variant with an
unrecognized name.source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize struct type received a field with an
unrecognized name.source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Raised when a
Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
input.source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Raised when a
Deserialize struct type received more than one of the
same field.source§impl PartialEq<TracebackError> for TracebackError
impl PartialEq<TracebackError> for TracebackError
Auto Trait Implementations§
impl RefUnwindSafe for TracebackError
impl Send for TracebackError
impl Sync for TracebackError
impl Unpin for TracebackError
impl UnwindSafe for TracebackError
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