pub struct FrameDecoder { /* private fields */ }Expand description
Decoder that accepts arbitrary transport-stream fragments.
Implementations§
Source§impl FrameDecoder
impl FrameDecoder
Sourcepub fn new(limits: DecodeLimits) -> Self
pub fn new(limits: DecodeLimits) -> Self
Creates a decoder with the specified memory limit.
Sourcepub fn try_new(limits: DecodeLimits) -> Result<Self, DecodeLimitsError>
pub fn try_new(limits: DecodeLimits) -> Result<Self, DecodeLimitsError>
Creates a decoder after rejecting invalid limits instead of clamping them.
Sourcepub const fn limits(&self) -> DecodeLimits
pub const fn limits(&self) -> DecodeLimits
Returns the effective decoder limits.
Sourcepub fn push(&mut self, fragment: &[u8]) -> Vec<DecodeEvent>
pub fn push(&mut self, fragment: &[u8]) -> Vec<DecodeEvent>
Adds a fragment and returns all completed events.
Sourcepub const fn statistics(&self) -> DecodeStatistics
pub const fn statistics(&self) -> DecodeStatistics
Returns accumulated counters.
Sourcepub fn buffered_len(&self) -> usize
pub fn buffered_len(&self) -> usize
Returns the number of incomplete buffered bytes.
Trait Implementations§
Source§impl Clone for FrameDecoder
impl Clone for FrameDecoder
Source§impl Debug for FrameDecoder
impl Debug for FrameDecoder
Auto Trait Implementations§
impl Freeze for FrameDecoder
impl RefUnwindSafe for FrameDecoder
impl Send for FrameDecoder
impl Sync for FrameDecoder
impl Unpin for FrameDecoder
impl UnsafeUnpin for FrameDecoder
impl UnwindSafe for FrameDecoder
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