Skip to main content

CaptureBuffer

Struct CaptureBuffer 

Source
pub struct CaptureBuffer { /* private fields */ }
Expand description

Fixed-capacity queue of interleaved wire frames. Configure once before transfer submission; retain newest frames when the reader falls behind.

Implementations§

Source§

impl CaptureBuffer

Source

pub fn new( format: CaptureFormat, capacity_frames: usize, ) -> Result<Self, CaptureError>

Source

pub fn format(&self) -> &CaptureFormat

Source

pub fn available_frames(&self) -> usize

Source

pub fn stats(&self) -> CaptureStats

Source

pub fn state(&self) -> CaptureState

Source

pub fn stop(&mut self)

Source

pub fn fail(&mut self)

Source

pub fn ingest_completion( &mut self, data: &[u8], submitted: &[usize], packets: &[CapturePacket], transfer_succeeded: bool, known_missing_frames: u64, ) -> Result<(), CaptureError>

Validate the entire submitted geometry before accepting any payload. Buffer length must equal the sum of immutable submitted packet lengths; packet offsets advance by submitted capacity, never by actual length. Failed transfers have no trustworthy payload, regardless of packet flags.

Source

pub fn read(&mut self, destination: &mut [u8]) -> Result<usize, CaptureError>

Copy whole frames, returning their count. Zero means active but empty. Stop/failure are distinct errors even if old frames remain queued.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.