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 more