pub trait TextWrite {
type Error;
// Required methods
fn write_char(&mut self, ch: char) -> Result<(), Self::Error>;
fn write_chars(&mut self, chars: &[char]) -> Result<(), Self::Error>;
fn write_str(&mut self, text: &str) -> Result<(), Self::Error>;
fn write_line(&mut self, line: &str) -> Result<(), Self::Error>;
fn flush(&mut self) -> Result<(), Self::Error>;
// Provided method
fn line_ending(&self) -> LineEnding { ... }
}Expand description
Writes Unicode text to a text sink.
TextWrite accepts Rust Unicode text and delegates byte encoding, storage,
logging, or other sink-specific behavior to the concrete implementation.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn line_ending(&self) -> LineEnding
fn line_ending(&self) -> LineEnding
Returns the configured line ending for TextWrite::write_line.
§Returns
The configured line ending. Implementations default to LineEnding::Lf.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".