pub struct FlvBuffer { /* private fields */ }Implementations§
Source§impl FlvBuffer
impl FlvBuffer
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new FlvBuffer with the specified capacity. The actual capacity will be rounded up to the next power of two.
Sourcepub fn write_data(&mut self, data: &[u8])
pub fn write_data(&mut self, data: &[u8])
Writes data into the ring buffer.
This method handles:
- Buffer resizing if needed
- Wrapping around the buffer end
- High-performance memory copying using
copy_nonoverlapping
§Performance
Uses unsafe copy_nonoverlapping for optimal memory copying performance,
avoiding bounds checks and overlapping memory verification.
Sourcepub fn get_flv_header(&self) -> Option<&FlvHeader>
pub fn get_flv_header(&self) -> Option<&FlvHeader>
Returns a reference to the parsed FLV header, if available.
Sourcepub fn get_flv_tag(&mut self) -> Option<FlvTag>
pub fn get_flv_tag(&mut self) -> Option<FlvTag>
Attempts to parse and return a complete FLV tag from the buffer.
§Returns
Some(FlvTag)if a complete tag is availableNoneif there isn’t enough data for a complete tag
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlvBuffer
impl RefUnwindSafe for FlvBuffer
impl Send for FlvBuffer
impl Sync for FlvBuffer
impl Unpin for FlvBuffer
impl UnwindSafe for FlvBuffer
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