pub enum ReliableClientFrame {
Data {
sequence: u64,
payload: Vec<u8>,
},
Ack {
sequence: u64,
},
}Expand description
Encoded reliable client frame.
Variants§
Implementations§
Source§impl ReliableClientFrame
impl ReliableClientFrame
Sourcepub fn encode_data(
sequence: u64,
payload: &[u8],
out: &mut Vec<u8>,
) -> Result<(), ReliableClientEncodeError>
pub fn encode_data( sequence: u64, payload: &[u8], out: &mut Vec<u8>, ) -> Result<(), ReliableClientEncodeError>
Appends a data frame from a borrowed payload without materializing an owned frame.
Sourcepub fn encode(&self, out: &mut Vec<u8>) -> Result<(), ReliableClientEncodeError>
pub fn encode(&self, out: &mut Vec<u8>) -> Result<(), ReliableClientEncodeError>
Encodes a reliable client frame.
Sourcepub fn decode(input: &[u8]) -> Result<Self, ReliableClientDecodeError>
pub fn decode(input: &[u8]) -> Result<Self, ReliableClientDecodeError>
Decodes a reliable client frame.
Sourcepub fn decode_ref(
input: &[u8],
) -> Result<ReliableClientFrameRef<'_>, ReliableClientDecodeError>
pub fn decode_ref( input: &[u8], ) -> Result<ReliableClientFrameRef<'_>, ReliableClientDecodeError>
Decodes a reliable client frame while borrowing data payload bytes.
Trait Implementations§
Source§impl Clone for ReliableClientFrame
impl Clone for ReliableClientFrame
Source§fn clone(&self) -> ReliableClientFrame
fn clone(&self) -> ReliableClientFrame
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ReliableClientFrame
impl Debug for ReliableClientFrame
impl Eq for ReliableClientFrame
Source§impl PartialEq for ReliableClientFrame
impl PartialEq for ReliableClientFrame
impl StructuralPartialEq for ReliableClientFrame
Auto Trait Implementations§
impl Freeze for ReliableClientFrame
impl RefUnwindSafe for ReliableClientFrame
impl Send for ReliableClientFrame
impl Sync for ReliableClientFrame
impl Unpin for ReliableClientFrame
impl UnsafeUnpin for ReliableClientFrame
impl UnwindSafe for ReliableClientFrame
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