Trait ApiError

Source
pub trait ApiError {
    // Required methods
    fn from_error_code(code: u16) -> Self;
    fn to_error_code(&self) -> u16;
}
Expand description

Used on enums representing errors that a call to an API returned.

Required Methods§

Source

fn from_error_code(code: u16) -> Self

Converts an error code to the enum variant.

Source

fn to_error_code(&self) -> u16

Converts an error variant to the matching error code.

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.

Implementors§