Struct bytes::buf::ROByteBuf
[−]
[src]
pub struct ROByteBuf { // some fields omitted }
Same as ByteBuf
but cannot be flipped to a MutByteBuf
.
Methods
impl ROByteBuf
unsafe fn from_mem_ref(mem: MemRef, cap: u32, pos: u32, lim: u32) -> ROByteBuf
fn to_seq_byte_str(self) -> SeqByteStr
fn to_bytes(self) -> Bytes
fn mark(&mut self)
Marks the current read location.
Together with reset
, this can be used to read from a section of the
buffer multiple times.
fn reset(&mut self)
Resets the read position to the previously marked position.
Together with mark
, this can be used to read from a section of the
buffer multiple times.
Panics
This method will panic if no mark has been set.