pub struct Nop {}Expand description
Nop is a SpanningTransformer that copies src to dst.
§Examples
Basic usage:
let src = b"Does nothing";
let dst = &mut [0; 8];
let (ndst, nsrc) = Nop::new().transform(dst, src, false)?;
assert_eq!(ndst, 8);
assert_eq!(nsrc, 8);
assert_eq!(dst, b"Does not");Implementations§
Trait Implementations§
Source§impl SpanningTransformer for Nop
impl SpanningTransformer for Nop
Source§fn span(&self, src: &[u8], _: bool) -> Result<usize>
fn span(&self, src: &[u8], _: bool) -> Result<usize>
Span returns a position in src such that transforming src[:n] results in identical output
src[:n] for these bytes. It does not necessarily return the largest such n. The atEOF
argument tells whether src represents the last bytes of the input. Read more
Source§impl Transformer for Nop
impl Transformer for Nop
Auto Trait Implementations§
impl Freeze for Nop
impl RefUnwindSafe for Nop
impl Send for Nop
impl Sync for Nop
impl Unpin for Nop
impl UnwindSafe for Nop
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more