pub struct Renderer<S>where
S: ScopeData,{ /* private fields */ }Expand description
Stateful renderer for chunked OutputToken streams.
Renderer is the push-based counterpart to render_tokens_iter. It
preserves the active scope stack across calls so format writers can consume
rendered tokens as soon as upstream engine and middleware stages release
them, without losing inline-markup restrictions from earlier chunks.
Implementations§
Source§impl<S> Renderer<S>where
S: ScopeData,
impl<S> Renderer<S>where
S: ScopeData,
Sourcepub fn new<O>(options: O) -> Renderer<S>where
O: Into<RenderOptions>,
pub fn new<O>(options: O) -> Renderer<S>where
O: Into<RenderOptions>,
Creates a renderer with the supplied rendering options.
Sourcepub fn push_token(&mut self, token: OutputToken<S>) -> RenderedToken<S>
pub fn push_token(&mut self, token: OutputToken<S>) -> RenderedToken<S>
Pushes one output token and returns its rendered counterpart.
Auto Trait Implementations§
impl<S> Freeze for Renderer<S>
impl<S> RefUnwindSafe for Renderer<S>
impl<S> Send for Renderer<S>
impl<S> Sync for Renderer<S>
impl<S> Unpin for Renderer<S>
impl<S> UnsafeUnpin for Renderer<S>
impl<S> UnwindSafe for Renderer<S>
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