pub struct TemplateEngine { /* private fields */ }Implementations§
Source§impl TemplateEngine
impl TemplateEngine
pub fn new() -> Self
pub fn register(&self, name: &str, template: &str) -> Result<(), WebhookError>
Sourcepub fn update(&self, name: &str, template: &str) -> Result<(), WebhookError>
pub fn update(&self, name: &str, template: &str) -> Result<(), WebhookError>
Overwrites an existing template or registers it if it doesn’t exist yet.
pub fn remove(&self, name: &str)
pub fn render(&self, name: &str, data: &Value) -> Result<String, WebhookError>
pub fn has_template(&self, name: &str) -> bool
Trait Implementations§
Source§impl Clone for TemplateEngine
impl Clone for TemplateEngine
Source§fn clone(&self) -> TemplateEngine
fn clone(&self) -> TemplateEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TemplateEngine
impl RefUnwindSafe for TemplateEngine
impl Send for TemplateEngine
impl Sync for TemplateEngine
impl Unpin for TemplateEngine
impl UnsafeUnpin for TemplateEngine
impl UnwindSafe for TemplateEngine
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