valico::common::error

Trait ValicoError

Source
pub trait ValicoError:
    Error
    + Send
    + Debug
    + GetTypeId {
    // Required methods
    fn get_code(&self) -> &str;
    fn get_path(&self) -> &str;
    fn get_title(&self) -> &str;

    // Provided method
    fn get_detail(&self) -> Option<&str> { ... }
}

Required Methods§

Source

fn get_code(&self) -> &str

Source

fn get_path(&self) -> &str

Source

fn get_title(&self) -> &str

Provided Methods§

Source

fn get_detail(&self) -> Option<&str>

Implementations§

Source§

impl dyn ValicoError

Source

pub fn is<E: ValicoError>(&self) -> bool

Is this Error object of type E?

Source

pub fn downcast<E: ValicoError>(&self) -> Option<&E>

If this error is E, downcast this error to E, by reference.

Trait Implementations§

Source§

impl Serialize for dyn ValicoError

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§