pub struct StreamReader {
pub data: Vec<u8>,
pub pos: usize,
pub frame_size: usize,
pub frames_read: usize,
}Expand description
Async-style streaming reader with frame callbacks.
Fields§
§data: Vec<u8>Input data.
pos: usizeRead position.
frame_size: usizeFrame size in bytes (fixed-size framing).
frames_read: usizeTotal frames read.
Implementations§
Source§impl StreamReader
impl StreamReader
Sourcepub fn read_frame(&mut self) -> Option<Vec<u8>>
pub fn read_frame(&mut self) -> Option<Vec<u8>>
Read next frame. Returns None if insufficient data.
Sourcepub fn append_data(&mut self, more: &[u8])
pub fn append_data(&mut self, more: &[u8])
Append more data (for streaming use).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamReader
impl RefUnwindSafe for StreamReader
impl Send for StreamReader
impl Sync for StreamReader
impl Unpin for StreamReader
impl UnsafeUnpin for StreamReader
impl UnwindSafe for StreamReader
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.