pub struct Sink<'a>(/* private fields */);Expand description
A Renderer that appends to a Trusted under construction.
This is what lets a document being built by hand reach the attribute
machinery — Attr, TokenList,
Attrs all write through a Renderer, and there is no
reason for tag! to own a second implementation of what
disabled or a token list means.
It escapes as HTML and lays nothing out, which is what a value being assembled in Rust wants: there is no template whose newlines a policy could be about.
Trait Implementations§
Source§impl Renderer for Sink<'_>
impl Renderer for Sink<'_>
Source§fn finish(self: Box<Self>) -> String
fn finish(self: Box<Self>) -> String
The output is the Trusted this was borrowed from, which the caller
still holds — so there is nothing to hand back here.
Source§fn write_escaped(&mut self, value: &dyn Display)
fn write_escaped(&mut self, value: &dyn Display)
Append a value, applying this renderer’s escaping policy. Read more
Source§fn write_text(&mut self, s: &str)
fn write_text(&mut self, s: &str)
Append literal text from between a template’s tags. Read more
Source§fn write_display_raw(&mut self, value: &dyn Display)
fn write_display_raw(&mut self, value: &dyn Display)
Append a value with no escaping. Read more
Source§fn push_indent(&mut self, levels: usize)
fn push_indent(&mut self, levels: usize)
Enter
levels of nesting, for renderers that lay their output out. Read moreSource§fn pop_indent(&mut self, levels: usize)
fn pop_indent(&mut self, levels: usize)
Leave
levels opened by push_indent.Source§fn close_line(&mut self, depth: usize)
fn close_line(&mut self, depth: usize)
Set the indentation already written for the current line to
depth
levels below the running total, because what comes next is the end tag
of an element at that depth. Read moreSource§fn set_verbatim(&mut self, on: bool)
fn set_verbatim(&mut self, on: bool)
Enter or leave a region where whitespace is significant — the content of
<pre>, <textarea>, <script> and <style>, where a space this
renderer added is a space the reader gets. Read moreAuto Trait Implementations§
impl<'a> !UnwindSafe for Sink<'a>
impl<'a> Freeze for Sink<'a>
impl<'a> RefUnwindSafe for Sink<'a>
impl<'a> Send for Sink<'a>
impl<'a> Sync for Sink<'a>
impl<'a> Unpin for Sink<'a>
impl<'a> UnsafeUnpin for Sink<'a>
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