Struct hacspec_lib::buf::ByteBuffer
source · [−]pub struct ByteBuffer { /* private fields */ }Implementations
sourceimpl ByteBuffer
impl ByteBuffer
sourcepub fn new() -> ByteBuffer
pub fn new() -> ByteBuffer
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. Create an empty buffer.
sourcepub fn from_seq(seq: Bytes) -> ByteBuffer
pub fn from_seq(seq: Bytes) -> ByteBuffer
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
Create a buffer from Bytes.
sourcepub fn concat_owned(self, seq: Bytes) -> ByteBuffer
pub fn concat_owned(self, seq: Bytes) -> ByteBuffer
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
Add a new chunk of Bytes to this ByteBuffer.
sourcepub fn split_off(self, len: usize) -> (Bytes, ByteBuffer)
pub fn split_off(self, len: usize) -> (Bytes, ByteBuffer)
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
Split off num bytes and return the Bytes.
sourcepub fn to_bytes(&self) -> Bytes
pub fn to_bytes(&self) -> Bytes
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
Get the buffer a single Bytes object (not efficient).
sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
Get the buffer a single Bytes object (efficient, consuming the buffer).
Trait Implementations
sourceimpl Clone for ByteBuffer
impl Clone for ByteBuffer
sourcefn clone(&self) -> ByteBuffer
fn clone(&self) -> ByteBuffer
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for ByteBuffer
impl Send for ByteBuffer
impl Sync for ByteBuffer
impl Unpin for ByteBuffer
impl UnwindSafe for ByteBuffer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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