Struct line_wrap::SliceLineEnding
source · pub struct SliceLineEnding<'a> { /* private fields */ }
Expand description
A byte slice line ending.
Gives up some throughput compared to the specialized single/double byte impls, but works with any length.
Examples
use line_wrap::*;
let ending = SliceLineEnding::new(b"xyz");
let mut data = vec![1, 2, 3, 4, 5, 6, 255, 255, 255, 255, 255, 255];
assert_eq!(6, line_wrap(&mut data[..], 6, 2, &ending));
assert_eq!(vec![1, 2, b'x', b'y', b'z', 3, 4, b'x', b'y', b'z', 5, 6], data);
Implementations
sourceimpl<'a> SliceLineEnding<'a>
impl<'a> SliceLineEnding<'a>
pub fn new(slice: &[u8]) -> SliceLineEnding<'_>
Trait Implementations
sourceimpl<'a> LineEnding for SliceLineEnding<'a>
impl<'a> LineEnding for SliceLineEnding<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for SliceLineEnding<'a>
impl<'a> Send for SliceLineEnding<'a>
impl<'a> Sync for SliceLineEnding<'a>
impl<'a> Unpin for SliceLineEnding<'a>
impl<'a> UnwindSafe for SliceLineEnding<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more