pub struct Packet { /* private fields */ }Expand description
Represents a packet unit for ezrpc
Implementations§
Source§impl Packet
impl Packet
pub fn from_pack(pack: Vec<u8>) -> Result<Self>
Sourcepub fn decode<'a, T: Deserialize<'a>>(&'a self) -> Result<T, impl StdError>
pub fn decode<'a, T: Deserialize<'a>>(&'a self) -> Result<T, impl StdError>
Deserialize the data in the packet
pub fn decode_to<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>
Sourcepub fn request_id(&self) -> Option<u32>
pub fn request_id(&self) -> Option<u32>
Get the request id
Trait Implementations§
Source§impl FromPacket for Packet
impl FromPacket for Packet
fn from_packet(pack: Packet) -> Result<Self>
Auto Trait Implementations§
impl Freeze for Packet
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
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