pub struct FileTemplateStore { /* private fields */ }Expand description
File-based template store
Stores each template as a JSON file in a directory. Template ID becomes the filename (UUID).
§Example
use stygian_plugin::storage::FileTemplateStore;
use std::path::PathBuf;
let store = FileTemplateStore::new(PathBuf::from("./templates"));Implementations§
Trait Implementations§
Source§impl PluginTemplateStore for FileTemplateStore
impl PluginTemplateStore for FileTemplateStore
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
template: &'life1 ExtractionTemplate,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
template: &'life1 ExtractionTemplate,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save or update a template
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<ExtractionTemplate>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<ExtractionTemplate>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a template by ID
Source§fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ExtractionTemplate>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ExtractionTemplate>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all templates
Auto Trait Implementations§
impl Freeze for FileTemplateStore
impl RefUnwindSafe for FileTemplateStore
impl Send for FileTemplateStore
impl Sync for FileTemplateStore
impl Unpin for FileTemplateStore
impl UnsafeUnpin for FileTemplateStore
impl UnwindSafe for FileTemplateStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more