Skip to main content

Input

Enum Input 

Source
#[non_exhaustive]
pub enum Input { Chunk { now_us: Duration, bytes: u32, pcr: Option<Clock27>, }, TrackMedia { now_us: Duration, track: u32, end: Clock27, }, Tick { now_us: Duration, pts: Option<Clock27>, }, Register { now_us: Duration, track: u32, }, Unregister { now_us: Duration, track: u32, }, Hint { now_us: Duration, hint: Hint, }, }
Expand description

One call a host made into a BufferController.

Times are the host’s monotonic microseconds; positions and media ends are 27 MHz ticks.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Chunk

Fields

§now_us: Duration

Arrival time.

§bytes: u32

Chunk length.

§pcr: Option<Clock27>

Last PCR of the chunk, 27 MHz.

§

TrackMedia

BufferController::on_track_media: a track’s buffered media now ends at end.

Fields

§now_us: Duration

Report time.

§track: u32

Track key.

§end: Clock27

Media end, 27 MHz.

§

Tick

BufferController::on_tick: the renderer’s playback position.

Fields

§now_us: Duration

Tick time.

§pts: Option<Clock27>

Playback position, 27 MHz.

§

Register

Fields

§now_us: Duration

Time of the call.

§track: u32

Track key.

§

Unregister

Fields

§now_us: Duration

Time of the call.

§track: u32

Track key.

§

Hint

Fields

§now_us: Duration

Hint time.

§hint: Hint

The hint.

Implementations§

Source§

impl Input

Source

pub const CSV_HEADER: &'static str = "kind,now_us,a,b"

Header row of a text log.

Source

pub fn name(&self) -> &'static str

Stable label.

Source

pub fn now_us(&self) -> Duration

The time of the call.

Source

pub fn rebased(self, origin_us: Duration) -> Self

The same input with its time moved origin earlier (saturating).

Source

pub fn apply(&self, controller: &mut BufferController)

Makes the call this input records on controller. Replay is a loop over this.

Source

pub fn write_row(&self, out: &mut impl Write) -> Result

Writes one row (columns of Input::CSV_HEADER) without a trailing newline.

§Errors

Whatever out reports.

Source

pub fn parse_row(line: &str) -> Result<Self, InputLogError>

Parses one input row; the inverse of Input::write_row. A missing trailing column is read as empty.

§Errors

InputLogError naming the row and the reason; config, seed and header rows are not inputs.

Trait Implementations§

Source§

impl Clone for Input

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 Copy for Input

Source§

impl Debug for Input

Source§

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

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

impl Display for Input

Source§

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

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

impl Eq for Input

Source§

impl PartialEq for Input

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Input

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Input

Auto Trait Implementations§

§

impl Forget for Input

§

impl Freeze for Input

§

impl Move for Input

§

impl RefUnwindSafe for Input

§

impl Send for Input

§

impl Sync for Input

§

impl Unpin for Input

§

impl UnsafeUnpin for Input

§

impl UnwindSafe for Input

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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.