pub struct PacketScanner;Expand description
Scanner for discovering sections in TPX3 data.
Implementations§
Source§impl PacketScanner
impl PacketScanner
Sourcepub fn scan_sections(data: &[u8], is_eof: bool) -> (Vec<Section>, usize)
pub fn scan_sections(data: &[u8], is_eof: bool) -> (Vec<Section>, usize)
Scans the provided data for TPX3 sections.
The data should be 8-byte aligned.
§Arguments
data- The byte slice to scan.is_eof- Whether this is the final chunk of data.
§Returns
A tuple (sections, consumed_bytes).
consumed_bytes indicates how many bytes can be safely advanced.
Bytes after consumed_bytes belong to an incomplete section (unless is_eof).
§Panics
Panics if a chunk is not exactly 8 bytes. This should be unreachable because
chunks_exact(8) guarantees each chunk length.
Auto Trait Implementations§
impl Freeze for PacketScanner
impl RefUnwindSafe for PacketScanner
impl Send for PacketScanner
impl Sync for PacketScanner
impl Unpin for PacketScanner
impl UnwindSafe for PacketScanner
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more