pub struct BytesField(pub Vec<u8>);Expand description
A variable-length byte field
Tuple Fields§
§0: Vec<u8>Implementations§
Source§impl BytesField
impl BytesField
pub fn new(data: Vec<u8>) -> Self
pub fn from_slice(data: &[u8]) -> Self
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn read_with_len( buf: &[u8], offset: usize, len: usize, ) -> Result<Self, FieldError>
pub fn write_to(&self, buf: &mut [u8], offset: usize) -> Result<(), FieldError>
Trait Implementations§
Source§impl Clone for BytesField
impl Clone for BytesField
Source§fn clone(&self) -> BytesField
fn clone(&self) -> BytesField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BytesField
impl Debug for BytesField
Source§impl Default for BytesField
impl Default for BytesField
Source§fn default() -> BytesField
fn default() -> BytesField
Returns the “default value” for a type. Read more
Source§impl From<&[u8]> for BytesField
impl From<&[u8]> for BytesField
Source§impl Hash for BytesField
impl Hash for BytesField
Source§impl PartialEq for BytesField
impl PartialEq for BytesField
impl Eq for BytesField
impl StructuralPartialEq for BytesField
Auto Trait Implementations§
impl Freeze for BytesField
impl RefUnwindSafe for BytesField
impl Send for BytesField
impl Sync for BytesField
impl Unpin for BytesField
impl UnsafeUnpin for BytesField
impl UnwindSafe for BytesField
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