pub struct Emitter { /* private fields */ }Expand description
Builds segmented output. Renderers append markup through this instead of a
bare String; frames capture sub-output (a deferred node’s children, or a
“did this render anything?” probe) without string sentinels.
Implementations§
Source§impl Emitter
impl Emitter
pub fn new() -> Self
pub fn push_str(&mut self, s: &str)
pub fn push(&mut self, c: char)
Sourcepub fn begin_frame(&mut self)
pub fn begin_frame(&mut self)
Start capturing output into a sub-frame.
Sourcepub fn end_frame(&mut self) -> Vec<Segment>
pub fn end_frame(&mut self) -> Vec<Segment>
Finish the current sub-frame and return what it captured.
Sourcepub fn append(&mut self, segments: Vec<Segment>)
pub fn append(&mut self, segments: Vec<Segment>)
Append previously captured segments to the current frame.
pub fn emit_deferred( &mut self, node_type: String, attrs_json: String, child_types: Vec<String>, content: Vec<Segment>, )
pub fn into_segments(self) -> Vec<Segment>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Emitter
impl RefUnwindSafe for Emitter
impl Send for Emitter
impl Sync for Emitter
impl Unpin for Emitter
impl UnsafeUnpin for Emitter
impl UnwindSafe for Emitter
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