Skip to main content

MoqTraceReader

Struct MoqTraceReader 

Source
pub struct MoqTraceReader<R: Read> {
    inner: R,
    header: TraceHeader,
}
Expand description

Streaming reader for .moqtrace files.

Validates the preamble and parses the header on construction. Events are then read one at a time via read_event or by iterating with into_iter.

Fields§

§inner: R§header: TraceHeader

Implementations§

Source§

impl<R: Read> MoqTraceReader<R>

Source

pub fn new(reader: R) -> Result<Self, MoqTraceError>

Open a reader, validating the preamble and parsing the header.

Source

pub fn header(&self) -> &TraceHeader

Return a reference to the parsed header.

Source

pub fn read_event(&mut self) -> Result<Option<TraceEvent>, MoqTraceError>

Read the next event from the stream.

Returns Ok(None) at EOF.

Trait Implementations§

Source§

impl<R: Debug + Read> Debug for MoqTraceReader<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Read> IntoIterator for MoqTraceReader<R>

Source§

type Item = Result<TraceEvent, MoqTraceError>

The type of the elements being iterated over.
Source§

type IntoIter = MoqTraceIterator<R>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<R> Freeze for MoqTraceReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for MoqTraceReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for MoqTraceReader<R>
where R: Send,

§

impl<R> Sync for MoqTraceReader<R>
where R: Sync,

§

impl<R> Unpin for MoqTraceReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for MoqTraceReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for MoqTraceReader<R>
where R: UnwindSafe,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.