pub struct MustacheStorage { /* private fields */ }Expand description
Storage layer for mustache templates
Implementations§
Source§impl MustacheStorage
impl MustacheStorage
Sourcepub async fn new(config: MustacheStorageConfig) -> Result<Self, MustacheError>
pub async fn new(config: MustacheStorageConfig) -> Result<Self, MustacheError>
Create a new mustache storage instance
Sourcepub async fn get_template(
&self,
plugin_id: &Uuid,
method: &str,
name: &str,
) -> Result<Option<String>, MustacheError>
pub async fn get_template( &self, plugin_id: &Uuid, method: &str, name: &str, ) -> Result<Option<String>, MustacheError>
Get a template by plugin_id, method, and name
Sourcepub async fn set_template(
&self,
plugin_id: &Uuid,
method: &str,
name: &str,
template: &str,
) -> Result<TemplateInfo, MustacheError>
pub async fn set_template( &self, plugin_id: &Uuid, method: &str, name: &str, template: &str, ) -> Result<TemplateInfo, MustacheError>
Set (insert or update) a template
Sourcepub async fn list_templates(
&self,
plugin_id: &Uuid,
) -> Result<Vec<TemplateInfo>, MustacheError>
pub async fn list_templates( &self, plugin_id: &Uuid, ) -> Result<Vec<TemplateInfo>, MustacheError>
List all templates for a plugin
Sourcepub async fn delete_template(
&self,
plugin_id: &Uuid,
method: &str,
name: &str,
) -> Result<bool, MustacheError>
pub async fn delete_template( &self, plugin_id: &Uuid, method: &str, name: &str, ) -> Result<bool, MustacheError>
Delete a template
Auto Trait Implementations§
impl Freeze for MustacheStorage
impl !RefUnwindSafe for MustacheStorage
impl Send for MustacheStorage
impl Sync for MustacheStorage
impl Unpin for MustacheStorage
impl UnsafeUnpin for MustacheStorage
impl !UnwindSafe for MustacheStorage
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more