Skip to main content

Buffer

Trait Buffer 

Source
pub trait Buffer {
    // Required methods
    fn write_element(&mut self, element: FormatElement);
    fn elements(&self) -> &[FormatElement];

    // Provided method
    fn write_elements<I>(&mut self, elements: I)
       where I: IntoIterator<Item = FormatElement> { ... }
}
Expand description

Output buffers used while constructing format documents.

Required Methods§

Source

fn write_element(&mut self, element: FormatElement)

Source

fn elements(&self) -> &[FormatElement]

Provided Methods§

Source

fn write_elements<I>(&mut self, elements: I)
where I: IntoIterator<Item = FormatElement>,

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 Buffer for VecBuffer

Source§

impl<Context> Buffer for Formatter<Context>