pub struct TemplateRegistry { /* private fields */ }Expand description
Immutable registry: venture overrides are inserted after module defaults
at Harness::build, so they win on id collision.
Implementations§
Source§impl TemplateRegistry
impl TemplateRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, id: impl Into<String>, template: Box<dyn Template>)
pub fn register(&mut self, id: impl Into<String>, template: Box<dyn Template>)
Inserts (or replaces) a template under id or id@<locale>.
Sourcepub fn register_all(
&mut self,
templates: impl IntoIterator<Item = (String, Box<dyn Template>)>,
)
pub fn register_all( &mut self, templates: impl IntoIterator<Item = (String, Box<dyn Template>)>, )
Registers every pair; later entries win on id collision, so call it with overrides last.
Trait Implementations§
Source§impl Clone for TemplateRegistry
impl Clone for TemplateRegistry
Source§fn clone(&self) -> TemplateRegistry
fn clone(&self) -> TemplateRegistry
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 TemplateRegistry
impl Debug for TemplateRegistry
Source§impl Default for TemplateRegistry
impl Default for TemplateRegistry
Source§fn default() -> TemplateRegistry
fn default() -> TemplateRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TemplateRegistry
impl !UnwindSafe for TemplateRegistry
impl Freeze for TemplateRegistry
impl Send for TemplateRegistry
impl Sync for TemplateRegistry
impl Unpin for TemplateRegistry
impl UnsafeUnpin for TemplateRegistry
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