pub struct ParseMetadata { /* private fields */ }
Expand description
Metadata about a previously-parsed packet used to undo its parsing.
See GrowBuffer::undo_parse
for more details.
Implementations§
Source§impl ParseMetadata
impl ParseMetadata
Sourcepub fn from_packet(
header_len: usize,
body_len: usize,
footer_len: usize,
) -> ParseMetadata
pub fn from_packet( header_len: usize, body_len: usize, footer_len: usize, ) -> ParseMetadata
Constructs a new ParseMetadata
from information about a packet.
Sourcepub fn from_inner_packet(len: usize) -> ParseMetadata
pub fn from_inner_packet(len: usize) -> ParseMetadata
Constructs a new ParseMetadata
from information about an inner packet.
Since inner packets do not have a header/body/footer distinction (at
least from the perspective of the utilities in this crate), we
arbitrarily produce a ParseMetadata
with a header length and no body
or footer lengths. Thus, from_inner_packet(len)
is equivalent to
from_packet(len, 0, 0)
.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Gets the header length.
header_len
returns the length of the header of the packet described by
this ParseMetadata
.
Sourcepub fn body_len(&self) -> usize
pub fn body_len(&self) -> usize
Gets the body length.
body_len
returns the length of the body of the packet described by
this ParseMetadata
.
Gets the footer length.
footer_len
returns the length of the footer of the packet described by
this ParseMetadata
.
Trait Implementations§
Source§impl Clone for ParseMetadata
impl Clone for ParseMetadata
Source§fn clone(&self) -> ParseMetadata
fn clone(&self) -> ParseMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ParseMetadata
impl Debug for ParseMetadata
Source§impl PartialEq for ParseMetadata
impl PartialEq for ParseMetadata
impl Copy for ParseMetadata
impl StructuralPartialEq for ParseMetadata
Auto Trait Implementations§
impl Freeze for ParseMetadata
impl RefUnwindSafe for ParseMetadata
impl Send for ParseMetadata
impl Sync for ParseMetadata
impl Unpin for ParseMetadata
impl UnwindSafe for ParseMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)