pub struct MailTemplateRegistry { /* private fields */ }Expand description
A product-owned template registry.
Implementations§
Source§impl MailTemplateRegistry
impl MailTemplateRegistry
Sourcepub const fn new(definitions: &'static [MailTemplateDefinition]) -> Self
pub const fn new(definitions: &'static [MailTemplateDefinition]) -> Self
Creates a registry from static product definitions.
Sourcepub const fn definitions(&self) -> &'static [MailTemplateDefinition]
pub const fn definitions(&self) -> &'static [MailTemplateDefinition]
Returns registered definitions in product order.
Sourcepub fn variable_groups(&self) -> Vec<TemplateVariableGroup>
pub fn variable_groups(&self) -> Vec<TemplateVariableGroup>
Returns variable groups in product registration order.
Sourcepub fn get(&self, code: &str) -> Option<&'static MailTemplateDefinition>
pub fn get(&self, code: &str) -> Option<&'static MailTemplateDefinition>
Looks up a template definition by code.
Sourcepub fn validate(&self) -> Result<(), MailTemplateRegistryError>
pub fn validate(&self) -> Result<(), MailTemplateRegistryError>
Validates that this static registry has unique template codes and variable keys.
Trait Implementations§
Source§impl Clone for MailTemplateRegistry
impl Clone for MailTemplateRegistry
Source§fn clone(&self) -> MailTemplateRegistry
fn clone(&self) -> MailTemplateRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MailTemplateRegistry
impl Debug for MailTemplateRegistry
impl Copy for MailTemplateRegistry
Auto Trait Implementations§
impl Freeze for MailTemplateRegistry
impl RefUnwindSafe for MailTemplateRegistry
impl Send for MailTemplateRegistry
impl Sync for MailTemplateRegistry
impl Unpin for MailTemplateRegistry
impl UnsafeUnpin for MailTemplateRegistry
impl UnwindSafe for MailTemplateRegistry
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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