pub trait ResponseWriter {
// Required methods
fn write(&mut self, content: &str) -> Result<()>;
fn end(&mut self) -> Result<()>;
// Provided methods
fn write_escaped(&mut self, content: &str) -> Result<()> { ... }
fn write_escaped_attribute(&mut self, name: &str, value: &str) -> Result<()> { ... }
}Expand description
Interface for writing rendered output
Required Methods§
Provided Methods§
Sourcefn write_escaped(&mut self, content: &str) -> Result<()>
fn write_escaped(&mut self, content: &str) -> Result<()>
Write untrusted text with the same HTML escaping as encode_safe.
Buffered writers may override this to append encoded text directly without allocating an intermediate string.
Sourcefn write_escaped_attribute(&mut self, name: &str, value: &str) -> Result<()>
fn write_escaped_attribute(&mut self, name: &str, value: &str) -> Result<()>
Write a quoted HTML attribute, escaping its untrusted value.
The name must already be a valid, trusted attribute name. Implementations
must preserve the six entity replacements used by encode_safe.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".