pub struct FixtureTransport { /* private fields */ }Expand description
A transport that plays nothing, on purpose.
It holds a snapshot the caller wrote and moves it only when a command asks it to: no clock runs, so the same scene renders the same pixels on every machine and in any order, which is what the visual gate needs. It records every command so a test can assert what a control asked for.
It reports MediaOrigin::Fixture, and every surface in this module
publishes and draws that, so a fixture on screen is never mistaken for a
player.
Implementations§
Source§impl FixtureTransport
impl FixtureTransport
Sourcepub fn new() -> Self
pub fn new() -> Self
A fixture holding nothing, which is MediaAvailability::Idle.
Sourcepub fn ready(duration: f32) -> Self
pub fn ready(duration: f32) -> Self
A fixture that holds media of a known length and is ready to move it.
pub fn state(self, state: TransportState) -> Self
Sourcepub fn position(self, seconds: f32) -> Self
pub fn position(self, seconds: f32) -> Self
Where the head stands. It stays there: nothing here advances it.
pub fn volume(self, volume: f32) -> Self
pub fn muted(self, muted: bool) -> Self
pub fn speed(self, speed: f32) -> Self
pub fn buffered(self, ranges: impl IntoIterator<Item = BufferedRange>) -> Self
pub fn loading(self) -> Self
Sourcepub fn no_backend(self, reason: impl Into<SharedString>) -> Self
pub fn no_backend(self, reason: impl Into<SharedString>) -> Self
Stands in for a machine with no backend that can play this.
Sourcepub fn failed(self, reason: impl Into<SharedString>) -> Self
pub fn failed(self, reason: impl Into<SharedString>) -> Self
Stands in for media that was opened and could not be read.
Sourcepub fn refusing(self, reason: impl Into<SharedString>) -> Self
pub fn refusing(self, reason: impl Into<SharedString>) -> Self
Makes every command answer MediaOutcome::Refused, which is how a
test proves a refused control changes nothing on screen.
Sourcepub fn unsupported(
self,
commands: impl IntoIterator<Item = &'static str>,
) -> Self
pub fn unsupported( self, commands: impl IntoIterator<Item = &'static str>, ) -> Self
Names commands this fixture does not implement, by
MediaCommand::name.
Sourcepub fn commands(&self) -> Vec<MediaCommand>
pub fn commands(&self) -> Vec<MediaCommand>
Every command asked of it, in order.
The fixture as a surface takes it.
Trait Implementations§
Source§impl Debug for FixtureTransport
impl Debug for FixtureTransport
Source§impl Default for FixtureTransport
impl Default for FixtureTransport
Source§impl MediaTransport for FixtureTransport
impl MediaTransport for FixtureTransport
Source§fn origin(&self) -> MediaOrigin
fn origin(&self) -> MediaOrigin
Source§fn snapshot(&self) -> MediaSnapshot
fn snapshot(&self) -> MediaSnapshot
Source§fn apply(&self, command: MediaCommand) -> MediaOutcome
fn apply(&self, command: MediaCommand) -> MediaOutcome
Auto Trait Implementations§
impl !Freeze for FixtureTransport
impl !RefUnwindSafe for FixtureTransport
impl !Sync for FixtureTransport
impl Send for FixtureTransport
impl Unpin for FixtureTransport
impl UnsafeUnpin for FixtureTransport
impl UnwindSafe for FixtureTransport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().