Trait line_wrap::LineEnding

source ·
pub trait LineEnding {
    // Required methods
    fn write_ending(&self, slice: &mut [u8]);
    fn len(&self) -> NonZeroUsize;
}
Expand description

Writes line endings.

The trait allows specialization for the common single and double byte cases, netting nice throughput improvements over simply using a slice for everything.

Required Methods§

source

fn write_ending(&self, slice: &mut [u8])

Write the line ending into the slice, which starts at the point where the ending should be written and is len() in length

source

fn len(&self) -> NonZeroUsize

The length of this particular line ending (must be constant)

Implementors§