pub(crate) struct Buf {
buf: Vec<u8>,
pos: usize,
}
Fields§
§buf: Vec<u8>
§pos: usize
Implementations§
Source§impl Buf
impl Buf
pub(crate) fn with_capacity(n: usize) -> Buf
pub(crate) fn is_empty(&self) -> bool
pub(crate) fn len(&self) -> usize
pub(crate) fn copy_to(&mut self, dst: &mut ReadBuf<'_>) -> usize
pub(crate) fn copy_from(&mut self, src: &[u8], max_buf_size: usize) -> usize
pub(crate) fn bytes(&self) -> &[u8] ⓘ
Sourcepub(crate) unsafe fn read_from<T: Read>(
&mut self,
rd: &mut T,
max_buf_size: usize,
) -> Result<usize>
pub(crate) unsafe fn read_from<T: Read>( &mut self, rd: &mut T, max_buf_size: usize, ) -> Result<usize>
§Safety
rd
must not read from the buffer read
is borrowing and must correctly
report the length of the data written into the buffer.
pub(crate) fn write_to<T: Write>(&mut self, wr: &mut T) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Buf
impl RefUnwindSafe for Buf
impl Send for Buf
impl Sync for Buf
impl Unpin for Buf
impl UnwindSafe for Buf
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