Error

Trait 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 { ... }
}
Available on crate feature wire only.
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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§

Source§

impl Error for nix_compat::wire::de::mock::Error

Available on crate features test only.