pub struct TemplateRegistry {
pub templates: BTreeMap<String, CodeTemplate>,
pub categories: BTreeMap<String, Vec<String>>,
pub metadata: RegistryMetadata,
}Expand description
Template registry for managing templates
Fields§
§templates: BTreeMap<String, CodeTemplate>Registered templates
categories: BTreeMap<String, Vec<String>>Template categories
metadata: RegistryMetadataRegistry metadata
Implementations§
Source§impl TemplateRegistry
impl TemplateRegistry
Sourcepub fn register_template(&mut self, template: CodeTemplate)
pub fn register_template(&mut self, template: CodeTemplate)
Register a new template
Sourcepub fn get_template(&self, name: &str) -> Option<&CodeTemplate>
pub fn get_template(&self, name: &str) -> Option<&CodeTemplate>
Get a template by name
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 · 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§impl<'de> Deserialize<'de> for TemplateRegistry
impl<'de> Deserialize<'de> for TemplateRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TemplateRegistry
impl RefUnwindSafe for TemplateRegistry
impl Send for TemplateRegistry
impl Sync for TemplateRegistry
impl Unpin for TemplateRegistry
impl UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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