pub struct SliceSink<'a> { /* private fields */ }Expand description
A cursor over a caller buffer.
No allocation; reports remaining; a put that does
not fit writes nothing. Debug prints the lengths only, never the bytes.
§Examples
use parse_net::{Sink, SliceSink};
let mut buf = [0u8; 8];
let mut out = SliceSink::new(&mut buf);
out.put(b"gzip")?;
assert_eq!(out.written(), b"gzip");
assert_eq!(out.remaining(), Some(4));
out.clear();
assert!(out.is_empty());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for SliceSink<'a>
impl<'a> Freeze for SliceSink<'a>
impl<'a> RefUnwindSafe for SliceSink<'a>
impl<'a> Send for SliceSink<'a>
impl<'a> Sync for SliceSink<'a>
impl<'a> Unpin for SliceSink<'a>
impl<'a> UnsafeUnpin for SliceSink<'a>
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