Skip to main content

DiskInterface

Trait DiskInterface 

Source
pub trait DiskInterface{
    const FILE_NAME: &'static str;
    const FORMAT: FileFormat;

    // Provided methods
    fn path() -> Result<PathBuf> { ... }
    fn load() -> Result<Self> { ... }
    fn save(&self) -> Result<()> { ... }
}

Required Associated Constants§

Provided Methods§

Source

fn path() -> Result<PathBuf>

Get the path to the file

Source

fn load() -> Result<Self>

Load the content from the file

Source

fn save(&self) -> Result<()>

Save settings to a file

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl DiskInterface for AddressBook

Source§

const FILE_NAME: &'static str = "address_book"

Source§

const FORMAT: FileFormat = FileFormat::YAML

Source§

impl DiskInterface for Config

Source§

const FILE_NAME: &'static str = "config"

Source§

const FORMAT: FileFormat = FileFormat::TOML

Source§

impl DiskInterface for InsecurePrivateKeyStore

Source§

const FILE_NAME: &'static str = "insecure_private_key_store"

Source§

const FORMAT: FileFormat = FileFormat::TOML

Source§

impl DiskInterface for NetworkStore

Source§

const FILE_NAME: &'static str = "networks"

Source§

const FORMAT: FileFormat = FileFormat::YAML