pub struct TransportBar { /* private fields */ }Expand description
A transport for one piece of media.
Implementations§
Source§impl TransportBar
impl TransportBar
pub fn new(ident: impl Into<Ident>) -> Self
Sourcepub fn label(self, label: impl Into<SharedString>) -> Self
pub fn label(self, label: impl Into<SharedString>) -> Self
What is playing, shown beside the controls.
pub fn state(self, state: TransportState) -> Self
pub fn duration(self, seconds: f32) -> Self
Sourcepub fn unknown_duration(self) -> Self
pub fn unknown_duration(self) -> Self
Says there is a position and no total, for a live stream.
Sourcepub fn elapsed(self, elapsed: impl Into<SharedString>) -> Self
pub fn elapsed(self, elapsed: impl Into<SharedString>) -> Self
How far in the media is, in the host’s own words. This crate formats no durations.
Sourcepub fn remaining(self, remaining: impl Into<SharedString>) -> Self
pub fn remaining(self, remaining: impl Into<SharedString>) -> Self
How much is left, in the host’s own words. Without one nothing is shown, because the remainder is a duration and this crate computes none.
Sourcepub fn buffered(self, ranges: impl IntoIterator<Item = BufferedRange>) -> Self
pub fn buffered(self, ranges: impl IntoIterator<Item = BufferedRange>) -> Self
The spans the host already holds. Supplying none draws no buffer.
pub fn muted(self, muted: bool) -> Self
Sourcepub fn speeds(self, speeds: impl IntoIterator<Item = f32>, current: f32) -> Self
pub fn speeds(self, speeds: impl IntoIterator<Item = f32>, current: f32) -> Self
The speeds the host offers, and which of them holds. Offering none leaves the control out entirely.
Sourcepub fn step_seconds(self, seconds: f32) -> Self
pub fn step_seconds(self, seconds: f32) -> Self
How far one arrow key jumps, in seconds.
A caller input, because whether an arrow should move a second or a minute is a judgement about the media, and this component knows nothing about the media.
pub fn has_previous(self, has_previous: bool) -> Self
pub fn has_next(self, has_next: bool) -> Self
pub fn on_event( self, handler: impl Fn(&TransportEvent, &mut Window, &mut App) + 'static, ) -> Self
Trait Implementations§
Source§impl Debug for TransportBar
impl Debug for TransportBar
Source§impl Disableable for TransportBar
impl Disableable for TransportBar
Source§impl IntoElement for TransportBar
impl IntoElement for TransportBar
Source§type Element = ViewElement<TransportBar>
type Element = ViewElement<TransportBar>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Source§impl RenderOnce for TransportBar
impl RenderOnce for TransportBar
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render this component into an element tree. Note that this method
takes ownership of self, as compared to
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for TransportBar
impl !Send for TransportBar
impl !Sync for TransportBar
impl !UnwindSafe for TransportBar
impl Freeze for TransportBar
impl Unpin for TransportBar
impl UnsafeUnpin for TransportBar
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<E> Flipping for Ewhere
E: IntoElement,
impl<E> Flipping for Ewhere
E: IntoElement,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
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> ⓘ
Converts
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> ⓘ
Converts
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 more