pub struct OpenRequest {
pub media: MediaItem,
pub selection: StreamSelection,
pub start: Duration,
pub audio_track: Option<i32>,
pub subtitle_track: Option<i32>,
pub autoplay: bool,
}Expand description
A request to present an item.
start is the reason this type exists. Carrying it here — rather than
leaving callers to seek after open — is what closes the load/seek race,
because the engine is the only layer that knows when its pipeline can accept
a position.
Fields§
§media: MediaItem§selection: StreamSelection§start: DurationWhere to begin. Duration::ZERO means the start of the item.
audio_track: Option<i32>§subtitle_track: Option<i32>§autoplay: boolBegin playing as soon as the engine is able.
Implementations§
Source§impl OpenRequest
impl OpenRequest
Sourcepub fn new(media: MediaItem, selection: StreamSelection) -> Self
pub fn new(media: MediaItem, selection: StreamSelection) -> Self
Open at the beginning, playing.
pub fn starting_at(self, start: Duration) -> Self
Trait Implementations§
Source§impl Clone for OpenRequest
impl Clone for OpenRequest
Source§fn clone(&self) -> OpenRequest
fn clone(&self) -> OpenRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OpenRequest
impl RefUnwindSafe for OpenRequest
impl Send for OpenRequest
impl Sync for OpenRequest
impl Unpin for OpenRequest
impl UnsafeUnpin for OpenRequest
impl UnwindSafe for OpenRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more