[][src]Trait line_wrap::LineEnding

pub trait LineEnding {
    fn write_ending(&self, slice: &mut [u8]);
fn len(&self) -> usize; }

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

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

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


impl LineEnding for ByteLineEnding

impl LineEnding for TwoByteLineEnding

impl<'a> LineEnding for SliceLineEnding<'a>