Trait Loadable

Source
pub trait Loadable: Sized {
    type Error: Debug + Display;

    // Required method
    fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Self::Error>;
}
Expand description

A value that can be loaded from a file.

Required Associated Types§

Source

type Error: Debug + Display

Error that can occur when attempting to load.

Required Methods§

Source

fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Self::Error>

Loads a value from the given input path.

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 Loadable for (Chainspec, ChainspecRawBytes)

Source§

type Error = Error

Source§

fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Self::Error>

Source§

impl Loadable for Arc<SecretKey>

Source§

type Error = ErrorExt

Source§

fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Self::Error>

Source§

impl Loadable for Vec<u8>

Source§

type Error = ReadFileError

Source§

fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Self::Error>

Source§

impl Loadable for PKey<Private>

Source§

type Error = Error

Source§

fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Self::Error>

Source§

impl Loadable for X509

Source§

type Error = Error

Source§

fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Self::Error>

Implementors§