Struct blaze_pk::OpaquePacket
source · pub struct OpaquePacket(pub PacketHeader, pub Vec<u8>);
Expand description
Structure for packets that have been read where the contents are not know and are encoded as a vector of bytes.
Tuple Fields
0: PacketHeader
1: Vec<u8>
Implementations
sourceimpl OpaquePacket
impl OpaquePacket
sourcepub fn contents<R: Codec>(&self) -> CodecResult<R>
pub fn contents<R: Codec>(&self) -> CodecResult<R>
Reads the contents of this encoded packet and tries to decode
the R
from it.
sourcepub fn debug_decode(&self) -> CodecResult<String>
pub fn debug_decode(&self) -> CodecResult<String>
Debug decoding decodes self printing all the hit nodes
sourcepub fn read<R: Read>(input: &mut R) -> PacketResult<Self>where
Self: Sized,
pub fn read<R: Read>(input: &mut R) -> PacketResult<Self>where
Self: Sized,
Reads a packet from the provided input without parsing the contents of the packet
pub fn read_typed<R: Read, T: PacketComponents>(
input: &mut R
) -> PacketResult<(T, Self)>where
Self: Sized,
Trait Implementations
sourceimpl Debug for OpaquePacket
impl Debug for OpaquePacket
Auto Trait Implementations
impl RefUnwindSafe for OpaquePacket
impl Send for OpaquePacket
impl Sync for OpaquePacket
impl Unpin for OpaquePacket
impl UnwindSafe for OpaquePacket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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