Skip to main content

Trace

Struct Trace 

Source
pub struct Trace {
    pub session: Option<Session>,
    pub names: Names,
    pub tracks: Vec<(Track, NameId)>,
    pub records: Vec<Record>,
}
Expand description

A recording in memory: what it was made of, its names and tracks, and the rest of its records in the order written.

Fields§

§session: Option<Session>§names: Names§tracks: Vec<(Track, NameId)>§records: Vec<Record>

Implementations§

Source§

impl Trace

Source

pub fn new() -> Self

Source

pub fn from_bytes(b: &[u8]) -> Result<Trace, Error>

The recording these bytes hold, read up to where they stop.

Source

pub fn push(&mut self, r: Record)

Takes one record as a reader hands it: names and tracks into their tables, the session aside, the rest kept.

Source

pub fn slice(&self, tl: &Timeline, first: usize, last: usize) -> Trace

The records of frames first..=last of tl (this recording’s timeline) and their gaps, up to the last one’s present: what a range dragged across the bars reads, the session, names and tracks kept.

Source

pub fn name(&self, id: NameId) -> &str

A name’s string.

Source

pub fn track_name(&self, t: Track) -> &str

A track’s name: main, loop, or the one declared.

Source

pub fn to_bytes(&self) -> Vec<u8> ⓘ

The recording as bytes: the header, the session, every name and track, then the records.

Source

pub fn timeline(&self) -> Timeline

The timeline the records make.

Trait Implementations§

Source§

impl Clone for Trace

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Trace

Source§

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

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

impl Default for Trace

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl NameOf for Trace

Source§

fn name_of(&self, id: NameId) -> &str

Auto Trait Implementations§

§

impl Forget for Trace

§

impl Freeze for Trace

§

impl RefUnwindSafe for Trace

§

impl Send for Trace

§

impl Sync for Trace

§

impl Unpin for Trace

§

impl UnsafeUnpin for Trace

§

impl UnwindSafe for Trace

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.