pub struct ComponentRegistry { /* private fields */ }Expand description
Pre-compiled Handlebars templates for Markdown components.
Immutable and Sync — shared across rayon workers without locking.
Implementations§
Source§impl ComponentRegistry
impl ComponentRegistry
Sourcepub fn from_config(config: &Config) -> Result<Self, OrbitError>
pub fn from_config(config: &Config) -> Result<Self, OrbitError>
Loads every .hbs file from config.components_dir.
§Errors
Returns OrbitError::Template when templates cannot be read or compiled.
Sourcepub fn template_names(&self) -> &[String]
pub fn template_names(&self) -> &[String]
Returns the names of loaded component templates.
Sourcepub fn has_component(&self, name: &str) -> bool
pub fn has_component(&self, name: &str) -> bool
Returns true when a component template is registered.
Auto Trait Implementations§
impl !RefUnwindSafe for ComponentRegistry
impl !UnwindSafe for ComponentRegistry
impl Freeze for ComponentRegistry
impl Send for ComponentRegistry
impl Sync for ComponentRegistry
impl Unpin for ComponentRegistry
impl UnsafeUnpin for ComponentRegistry
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> 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