AsyncModelPersistence

Trait AsyncModelPersistence 

Source
pub trait AsyncModelPersistence {
    type Error: Error + Send + Sync;

    // Required methods
    fn save_async<'a>(
        &'a self,
        path: &'a Path,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
    fn load_async<'a>(
        path: &'a Path,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'a>>
       where Self: Sized;
    fn save_compressed_async<'a>(
        &'a self,
        path: &'a Path,
        compression_level: u32,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}
Expand description

Async model persistence

Required Associated Types§

Required Methods§

Source

fn save_async<'a>( &'a self, path: &'a Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Save model asynchronously

Source

fn load_async<'a>( path: &'a Path, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'a>>
where Self: Sized,

Load model asynchronously

Source

fn save_compressed_async<'a>( &'a self, path: &'a Path, compression_level: u32, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Save model with compression

Implementors§