pub struct ComponentRegistry { /* private fields */ }Implementations§
Source§impl ComponentRegistry
impl ComponentRegistry
pub fn new() -> Self
pub fn register(&mut self, path: &str, template: &str) -> Result<(), Error>
pub fn get(&self, path: &str) -> Option<&Component>
pub fn resolve_tag(&self, tag: &str) -> Option<String>
pub fn list_components(&self) -> Vec<String>
pub fn validate_props( &self, path: &str, provided: &Value, ) -> Result<HashMap<String, Value>, String>
pub fn enable_cache(&mut self, enabled: bool)
pub fn is_cache_enabled(&self) -> bool
pub fn get_cached(&self, key: u64) -> Option<String>
pub fn set_cached(&self, key: u64, html: String, props_hash: u64)
pub fn clear_cache(&self)
pub fn cache_len(&self) -> usize
Trait Implementations§
Source§impl Clone for ComponentRegistry
impl Clone for ComponentRegistry
Source§fn clone(&self) -> ComponentRegistry
fn clone(&self) -> ComponentRegistry
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 Default for ComponentRegistry
impl Default for ComponentRegistry
Source§fn default() -> ComponentRegistry
fn default() -> ComponentRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ComponentRegistry
impl RefUnwindSafe for ComponentRegistry
impl Send for ComponentRegistry
impl Sync for ComponentRegistry
impl Unpin for ComponentRegistry
impl UnsafeUnpin for ComponentRegistry
impl UnwindSafe 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> 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