Trait FsTrait

Source
pub trait FsTrait{
    type Key: Display;

    // Required method
    fn item_id(&self) -> Self::Key;

    // Provided methods
    fn crate_name() -> String { ... }
    fn root() -> PathBuf { ... }
    fn items_path() -> PathBuf { ... }
    fn item_path(&self) -> PathBuf { ... }
    fn load(id: Self::Key) -> Option<Self> { ... }
    fn save(&self) { ... }
}

Required Associated Types§

Required Methods§

Source

fn item_id(&self) -> Self::Key

Provided Methods§

Source

fn crate_name() -> String

Source

fn root() -> PathBuf

Source

fn items_path() -> PathBuf

Source

fn item_path(&self) -> PathBuf

Source

fn load(id: Self::Key) -> Option<Self>

Source

fn save(&self)

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§