pub struct TwoByteLineEnding { /* private fields */ }
Expand description

A double byte line ending.

See crlf().

Examples

use line_wrap::*;

let ending = TwoByteLineEnding::new(b'\r', b'\n');

let mut data = vec![1, 2, 3, 4, 5, 6, 255, 255, 255, 255];

assert_eq!(4, line_wrap(&mut data[..], 6, 2, &ending));

assert_eq!(vec![1, 2, b'\r', b'\n', 3, 4, b'\r', b'\n', 5, 6], data);

Implementations

Trait Implementations

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)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.