Skip to main content

AsyncClock

Trait AsyncClock 

Source
pub trait AsyncClock: PipelineClock {
    type SleepFuture<'a>: Future<Output = ()> + 'a
       where Self: 'a;

    // Required method
    fn sleep_until_ns<'a>(&'a self, deadline_ns: u64) -> Self::SleepFuture<'a>;
}
Expand description

Pipeline clock with async sleep capability. Used by elements that schedule work against the clock — sync sinks waiting for PTS, paced sources pacing themselves to a target framerate, jitter buffers, etc.

sleep_until_ns(deadline) resolves immediately if deadline <= now_ns().

Required Associated Types§

Source

type SleepFuture<'a>: Future<Output = ()> + 'a where Self: 'a

Required Methods§

Source

fn sleep_until_ns<'a>(&'a self, deadline_ns: u64) -> Self::SleepFuture<'a>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§