Skip to main content

Persistence

Trait Persistence 

Source
pub trait Persistence {
    // Required methods
    fn save(&self, path: &str) -> Result<()>;
    fn load(path: &str) -> Result<Self>
       where Self: Sized;
    fn exists(path: &str) -> bool;
    fn size(path: &str) -> Result<u64>;
}
Expand description

Persistence trait for knowledge graphs

Required Methods§

Source

fn save(&self, path: &str) -> Result<()>

Save knowledge graph to storage

Source

fn load(path: &str) -> Result<Self>
where Self: Sized,

Load knowledge graph from storage

Source

fn exists(path: &str) -> bool

Check if storage exists

Source

fn size(path: &str) -> Result<u64>

Get storage size in bytes

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§