pub trait PrinterTrait: Write + Sealed {
Show 17 methods
// Required methods
fn options(&self) -> &PrinterOptions<'_>;
fn state(&self) -> &PrinterState<'_, '_>;
fn state_mut(&mut self) -> &mut PrinterState<'_, '_>;
fn filename(&self) -> &str;
fn whitespace(&mut self) -> Result<(), PrinterError>;
fn delim(&mut self, c: char, ws_before: bool) -> Result<(), PrinterError>;
fn newline(&mut self) -> Result<(), PrinterError>;
fn write_str_with_newlines(&mut self, s: &str) -> Result<(), PrinterError>;
fn add_mapping(&mut self, loc: Location);
fn indent(&mut self);
fn dedent(&mut self);
fn indent_by(&mut self, amt: u8);
fn dedent_by(&mut self, amt: u8);
fn write_ident(
&mut self,
ident: &str,
handle_css_module: bool,
) -> Result<(), PrinterError>;
fn write_dashed_ident(
&mut self,
ident: &str,
is_declaration: bool,
) -> Result<(), PrinterError>;
fn without_css_module<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T;
// Provided method
fn error(
&self,
kind: PrinterErrorKind,
loc: Location,
) -> Error<PrinterErrorKind> { ... }
}Expand description
A printer abstraction used by CSS serialization implementations.
Required Methods§
fn options(&self) -> &PrinterOptions<'_>
fn state(&self) -> &PrinterState<'_, '_>
fn state_mut(&mut self) -> &mut PrinterState<'_, '_>
fn filename(&self) -> &str
fn whitespace(&mut self) -> Result<(), PrinterError>
fn delim(&mut self, c: char, ws_before: bool) -> Result<(), PrinterError>
fn newline(&mut self) -> Result<(), PrinterError>
fn write_str_with_newlines(&mut self, s: &str) -> Result<(), PrinterError>
fn add_mapping(&mut self, loc: Location)
fn indent(&mut self)
fn dedent(&mut self)
fn indent_by(&mut self, amt: u8)
fn dedent_by(&mut self, amt: u8)
fn write_ident( &mut self, ident: &str, handle_css_module: bool, ) -> Result<(), PrinterError>
fn write_dashed_ident( &mut self, ident: &str, is_declaration: bool, ) -> Result<(), PrinterError>
fn without_css_module<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T
Provided Methods§
fn error( &self, kind: PrinterErrorKind, loc: Location, ) -> Error<PrinterErrorKind>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".