pub struct OpaqueBytes(pub Vec<u8>);Expand description
A byte buffer for protocol data whose internal structure is not parsed by the codec.
Used for native protocol types (entityMetadata, registryEntryHolder,
etc.) and switch field fallbacks where the wire format is known
but too complex to represent in the type system.
Unlike raw Vec<u8>, OpaqueBytes makes the intent explicit:
“this data is intentionally unparsed”.
Tuple Fields§
§0: Vec<u8>Implementations§
Source§impl OpaqueBytes
impl OpaqueBytes
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Creates an opaque buffer from raw bytes.
Trait Implementations§
Source§impl Clone for OpaqueBytes
impl Clone for OpaqueBytes
Source§fn clone(&self) -> OpaqueBytes
fn clone(&self) -> OpaqueBytes
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 OpaqueBytes
impl Debug for OpaqueBytes
Source§impl Decode for OpaqueBytes
impl Decode for OpaqueBytes
Source§impl Default for OpaqueBytes
impl Default for OpaqueBytes
Source§fn default() -> OpaqueBytes
fn default() -> OpaqueBytes
Returns the “default value” for a type. Read more
Source§impl Encode for OpaqueBytes
impl Encode for OpaqueBytes
Source§impl EncodedSize for OpaqueBytes
impl EncodedSize for OpaqueBytes
fn encoded_size(&self) -> usize
Source§impl PartialEq for OpaqueBytes
impl PartialEq for OpaqueBytes
impl StructuralPartialEq for OpaqueBytes
Auto Trait Implementations§
impl Freeze for OpaqueBytes
impl RefUnwindSafe for OpaqueBytes
impl Send for OpaqueBytes
impl Sync for OpaqueBytes
impl Unpin for OpaqueBytes
impl UnsafeUnpin for OpaqueBytes
impl UnwindSafe for OpaqueBytes
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