jiff::fmt

Trait WriteExt

Source
trait WriteExt: Write {
    // Provided methods
    fn write_int(
        &mut self,
        formatter: &DecimalFormatter,
        n: impl Into<i64>,
    ) -> Result<(), Error> { ... }
    fn write_fraction(
        &mut self,
        formatter: &FractionalFormatter,
        n: impl Into<i64>,
    ) -> Result<(), Error> { ... }
    fn write_decimal(&mut self, decimal: &Decimal) -> Result<(), Error> { ... }
    fn write_fractional(&mut self, fractional: &Fractional) -> Result<(), Error> { ... }
}
Expand description

An extension trait to Write that provides crate internal routines.

These routines aren’t exposed because they make use of crate internal types. Those types could perhaps be exposed if there was strong demand, but I’m skeptical.

Provided Methods§

Source

fn write_int( &mut self, formatter: &DecimalFormatter, n: impl Into<i64>, ) -> Result<(), Error>

Write the given number as a decimal using ASCII digits to this buffer. The given formatter controls how the decimal is formatted.

Source

fn write_fraction( &mut self, formatter: &FractionalFormatter, n: impl Into<i64>, ) -> Result<(), Error>

Write the given fractional number using ASCII digits to this buffer. The given formatter controls how the fractional number is formatted.

Source

fn write_decimal(&mut self, decimal: &Decimal) -> Result<(), Error>

Write the given decimal number to this buffer.

Source

fn write_fractional(&mut self, fractional: &Fractional) -> Result<(), Error>

Write the given fractional number to this buffer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<W: Write> WriteExt for W