Skip to main content

CompiledNumberWriter

Trait CompiledNumberWriter 

Source
pub trait CompiledNumberWriter:
    Send
    + Sync
    + Debug {
    // Required methods
    fn write_one<'a>(
        &self,
        value: &NumberedValue<'a>,
        options: &FormatOptions,
        cx: &WriteCx<'a>,
        out: &mut NumberOut<'a>,
    ) -> Result<(), FormatError>;
    fn write_many<'a>(
        &self,
        values: &[NumberedValue<'a>],
        options: &FormatOptions,
        cx: &WriteCx<'a>,
        out: &mut NumberOut<'a>,
    ) -> Result<(), FormatError>;
}
Expand description

A compiled number writer: what writes the numbers of a counter style.

The two entry points are the two ways a number is asked for. One value comes through format, which a construct showing its own number and a reference to one point use. Several values of one counter style come through format_many, which writes a reference to several points: the writer receives all of them, with their ancestors, and decides which of them are written together.

Required Methods§

Source

fn write_one<'a>( &self, value: &NumberedValue<'a>, options: &FormatOptions, cx: &WriteCx<'a>, out: &mut NumberOut<'a>, ) -> Result<(), FormatError>

Writes one value into out.

§Errors

The FormatError of any operation the writer asked cx for.

Source

fn write_many<'a>( &self, values: &[NumberedValue<'a>], options: &FormatOptions, cx: &WriteCx<'a>, out: &mut NumberOut<'a>, ) -> Result<(), FormatError>

Writes several values of one counter style into out, in the order the writer chooses.

The values come in the caller’s order, and each carries its own ancestors. The list may be empty; the default writer then writes the counter style’s text for an empty list (JoinText::Empty).

§Errors

The FormatError of any operation the writer asked cx for.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§