Trait valico::common::error::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§