Struct logging_rs::errors::Error
source · pub struct Error {
pub name: String,
pub description: String,
pub exit_code: i32,
}
Expand description
Error object.
Use Error::new()
to create error objects instead of using this struct.
Parameters
name
: The errors name.description
: The error description.exit_code
: The errors exit code.
Returns
A new Error
object with the specified name and description.
Examples
logging_rs::errors::Error {
name: "name".to_owned(),
description: "description".to_owned(),
exit_code: 1
};
Fields§
§name: String
The errors name.
description: String
The error description.
exit_code: i32
The errors exit code.
Implementations§
source§impl Error
impl Error
sourcepub fn new(name: &str, description: &str, exit_code: i32) -> Error
pub fn new(name: &str, description: &str, exit_code: i32) -> Error
Creates a new error object.
Parameters
name
: The errors name.description
: The error description.exit_code
: The errors exit code.
Returns
A new Error
object with the specified name and description.
Examples
logging_rs::errors::Error::new("name", "description", 1);
See also
Trait Implementations§
source§impl Display for Error
impl Display for Error
Display implementation for the error object.
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format implementation for the error object.
Parameters
self
: The error object.f
: Thefmt::Formatter
to use.
Returns
A fmt::Result
containing the formatted error message.
Examples
println!("{}", error);
See also
source§impl Ord for Error
impl Ord for Error
source§impl PartialEq for Error
impl PartialEq for Error
source§impl PartialOrd for Error
impl PartialOrd for Error
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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