pub struct Timer { /* private fields */ }Expand description
Fluent native GPUI component for rendering Liora timer.
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn count_down(duration: Duration, elapsed: Duration) -> Self
pub fn count_down(duration: Duration, elapsed: Duration) -> Self
Sets the count down value used by the component.
Sourcepub fn new(
direction: TimerDirection,
elapsed: Duration,
duration: Option<Duration>,
) -> Self
pub fn new( direction: TimerDirection, elapsed: Duration, duration: Option<Duration>, ) -> Self
Creates Timer initialized from the supplied direction, elapsed, and duration.
Sourcepub fn id(self, id: impl Into<SharedString>) -> Self
pub fn id(self, id: impl Into<SharedString>) -> Self
Assigns a stable element id used by GPUI state, hit testing, and automated interaction tests.
Sourcepub fn duration(self, duration: Duration) -> Self
pub fn duration(self, duration: Duration) -> Self
Sets the duration value used by the component.
Sourcepub fn direction(self, direction: TimerDirection) -> Self
pub fn direction(self, direction: TimerDirection) -> Self
Selects the layout or animation direction.
Sourcepub fn display_unit(self, unit: TimerUnit) -> Self
pub fn display_unit(self, unit: TimerUnit) -> Self
Sets the display unit value used by the component.
Sourcepub fn format(self, format: TimerFormat) -> Self
pub fn format(self, format: TimerFormat) -> Self
Sets the format displayed or consumed by the component.
Sourcepub fn clock_format(self) -> Self
pub fn clock_format(self) -> Self
Sets the clock format value used by the component.
Sourcepub fn show_unit(self, show: bool) -> Self
pub fn show_unit(self, show: bool) -> Self
Configures whether unit is visible in the rendered component.
Sourcepub fn title(self, title: impl Into<SharedString>) -> Self
pub fn title(self, title: impl Into<SharedString>) -> Self
Sets the primary title text displayed by the component.
Sourcepub fn prefix(self, prefix: impl Into<SharedString>) -> Self
pub fn prefix(self, prefix: impl Into<SharedString>) -> Self
Sets the prefix value used by the component.
Sourcepub fn suffix(self, suffix: impl Into<SharedString>) -> Self
pub fn suffix(self, suffix: impl Into<SharedString>) -> Self
Sets the suffix value used by the component.
Sourcepub fn tick_interval(self, interval: Duration) -> Self
pub fn tick_interval(self, interval: Duration) -> Self
Sets the tick interval value used by the component.
Sourcepub fn snapshot(&self) -> TimerSnapshot
pub fn snapshot(&self) -> TimerSnapshot
Performs the snapshot operation used by this component.
Sourcepub fn elapsed_as(&self, unit: TimerUnit) -> f64
pub fn elapsed_as(&self, unit: TimerUnit) -> f64
Performs the elapsed as operation used by this component.
Sourcepub fn remaining_as(&self, unit: TimerUnit) -> Option<f64>
pub fn remaining_as(&self, unit: TimerUnit) -> Option<f64>
Performs the remaining as operation used by this component.
Trait Implementations§
Source§impl IntoElement for Timer
impl IntoElement for Timer
Source§type Element = Component<Timer>
type Element = Component<Timer>
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for Timer
impl RenderOnce for Timer
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnsafeUnpin for Timer
impl UnwindSafe for Timer
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,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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,
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,
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,
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 more