LogEnum

Enum LogEnum 

Source
pub enum LogEnum {
    Log(Log),
    Warning {
        date: NaiveDateTime,
        msg: Vec<String>,
    },
    Error {
        date: NaiveDateTime,
        msg: Vec<String>,
    },
    Exception {
        date: NaiveDateTime,
        msg: Vec<String>,
    },
    Unknown(String),
}

Variants§

§

Log(Log)

§

Warning

Fields

§

Error

Fields

§

Exception

Fields

§

Unknown(String)

Implementations§

Source§

impl LogEnum

Source

pub fn as_log_mut(&mut self) -> Option<&mut Log>

Optionally returns mutable references to the inner fields if this is a LogEnum::Log, otherwise None

Source

pub fn as_log(&self) -> Option<&Log>

Optionally returns references to the inner fields if this is a LogEnum::Log, otherwise None

Source

pub fn into_log(self) -> Result<Log, Self>

Returns the inner fields if this is a LogEnum::Log, otherwise returns back the enum in the Err case of the result

Source

pub fn as_warning_mut(&mut self) -> Option<(&mut DateTime, &mut Vec<String>)>

Optionally returns mutable references to the inner fields if this is a LogEnum::Warning, otherwise None

Source

pub fn as_warning(&self) -> Option<(&DateTime, &Vec<String>)>

Optionally returns references to the inner fields if this is a LogEnum::Warning, otherwise None

Source

pub fn into_warning(self) -> Result<(DateTime, Vec<String>), Self>

Returns the inner fields if this is a LogEnum::Warning, otherwise returns back the enum in the Err case of the result

Source

pub fn as_error_mut(&mut self) -> Option<(&mut DateTime, &mut Vec<String>)>

Optionally returns mutable references to the inner fields if this is a LogEnum::Error, otherwise None

Source

pub fn as_error(&self) -> Option<(&DateTime, &Vec<String>)>

Optionally returns references to the inner fields if this is a LogEnum::Error, otherwise None

Source

pub fn into_error(self) -> Result<(DateTime, Vec<String>), Self>

Returns the inner fields if this is a LogEnum::Error, otherwise returns back the enum in the Err case of the result

Source

pub fn as_exception_mut(&mut self) -> Option<(&mut DateTime, &mut Vec<String>)>

Optionally returns mutable references to the inner fields if this is a LogEnum::Exception, otherwise None

Source

pub fn as_exception(&self) -> Option<(&DateTime, &Vec<String>)>

Optionally returns references to the inner fields if this is a LogEnum::Exception, otherwise None

Source

pub fn into_exception(self) -> Result<(DateTime, Vec<String>), Self>

Returns the inner fields if this is a LogEnum::Exception, otherwise returns back the enum in the Err case of the result

Source

pub fn as_unknown_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a LogEnum::Unknown, otherwise None

Source

pub fn as_unknown(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a LogEnum::Unknown, otherwise None

Source

pub fn into_unknown(self) -> Result<String, Self>

Returns the inner fields if this is a LogEnum::Unknown, otherwise returns back the enum in the Err case of the result

Source§

impl LogEnum

Source

pub fn from_str(s: &str) -> Result<Self, ()>

Trait Implementations§

Source§

impl Debug for LogEnum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.