pub struct ComponentRenderer { /* private fields */ }Expand description
Runtime component renderer that manages slot content and stack buffers.
Used during template rendering to accumulate and manage component content.
Implementations§
Source§impl ComponentRenderer
impl ComponentRenderer
Sourcepub fn drain(&mut self, name: &str) -> String
pub fn drain(&mut self, name: &str) -> String
Drains and returns all content from a stack buffer, removing it.
Sourcepub fn peek(&self, name: &str) -> Option<String>
pub fn peek(&self, name: &str) -> Option<String>
Peeks at the content of a stack buffer without removing it.
Sourcepub fn set_slot_fill(&mut self, slot_name: &str, content: String)
pub fn set_slot_fill(&mut self, slot_name: &str, content: String)
Sets the fill content for a slot.
Sourcepub fn set_scoped_data(&mut self, slot_name: &str, key: &str, value: Value)
pub fn set_scoped_data(&mut self, slot_name: &str, key: &str, value: Value)
Sets scoped data for a slot.
Sourcepub fn get_scoped_data(&self, slot_name: &str) -> Option<HashMap<String, Value>>
pub fn get_scoped_data(&self, slot_name: &str) -> Option<HashMap<String, Value>>
Gets scoped data for a slot.
Trait Implementations§
Source§impl Clone for ComponentRenderer
impl Clone for ComponentRenderer
Source§fn clone(&self) -> ComponentRenderer
fn clone(&self) -> ComponentRenderer
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 ComponentRenderer
impl Default for ComponentRenderer
Source§fn default() -> ComponentRenderer
fn default() -> ComponentRenderer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ComponentRenderer
impl RefUnwindSafe for ComponentRenderer
impl Send for ComponentRenderer
impl Sync for ComponentRenderer
impl Unpin for ComponentRenderer
impl UnsafeUnpin for ComponentRenderer
impl UnwindSafe for ComponentRenderer
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