Trait nix_compat::wire::de::Error

source ·
pub trait Error: Sized + StdError {
    // Required method
    fn custom<T: Display>(msg: T) -> Self;

    // Provided methods
    fn io_error(err: Error) -> Self { ... }
    fn invalid_data<T: Display>(msg: T) -> Self { ... }
    fn missing_data<T: Display>(msg: T) -> Self { ... }
}
Expand description

Like serde the Error trait allows NixRead implementations to add custom error handling for NixDeserialize.

Required Methods§

source

fn custom<T: Display>(msg: T) -> Self

A totally custom non-specific error.

Provided Methods§

source

fn io_error(err: Error) -> Self

Some kind of std::io::Error occured.

source

fn invalid_data<T: Display>(msg: T) -> Self

The data read from NixRead is invalid. This could be that some bytes were supposed to be valid UFT-8 but weren’t.

source

fn missing_data<T: Display>(msg: T) -> Self

Required data is missing. This is mostly like an EOF

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Error for Error

source§

fn custom<T: Display>(msg: T) -> Self

source§

fn io_error(err: Error) -> Self

source§

fn invalid_data<T: Display>(msg: T) -> Self

source§

fn missing_data<T: Display>(msg: T) -> Self

Implementors§