INNER CODE UNIT · Rust

fmt

nativeshell/nativeshell · nativeshell/src/codec/value/mod.rs:104

    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match self {
            ValueError::Message(s) => write!(f, "{s}"),
            ValueError::ConversionError => write!(f, "Value can't be converted to target type"),
            ValueError::WrongType => write!(f, "Value is of wrong type"),
            ValueError::NoList => write!(f, "Value is not a list"),
            ValueError::NoMap => write!(f, "Value is not a map"),
        }
    }
}

impl serde::ser::Error for ValueError {
    fn custom<T>(msg: T) -> Self
    where
        T: fmt::Display,
    {
        ValueError::Message(msg.to_string())
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…