pub struct ShimmerStyle { /* private fields */ }Expand description
The appearance and timing of a reusable text shimmer.
By default, the highlight’s half-width spans 30% of the text width and completes one left-to-right sweep every two seconds. Its color follows the current text color and active theme.
Implementations§
Source§impl ShimmerStyle
impl ShimmerStyle
Sourcepub fn new() -> ShimmerStyle
pub fn new() -> ShimmerStyle
Create a theme-aware shimmer with the default timing and spread.
Sourcepub fn duration(self, duration: Duration) -> ShimmerStyle
pub fn duration(self, duration: Duration) -> ShimmerStyle
Set the duration of one complete sweep.
A zero duration is clamped to one millisecond.
Sourcepub fn highlight_color(self, color: impl Into<Hsla>) -> ShimmerStyle
pub fn highlight_color(self, color: impl Into<Hsla>) -> ShimmerStyle
Replace the theme-aware highlight with an explicit color.
Sourcepub fn spread(self, spread: impl Into<ShimmerSpread>) -> ShimmerStyle
pub fn spread(self, spread: impl Into<ShimmerSpread>) -> ShimmerStyle
Set the highlight half-width.
An f32 is a fraction of the text width; finite values are clamped to
the inclusive 0.05..=1.0 range and the default is 0.3. A Pixels
value is an absolute half-width with a one-pixel minimum. Non-finite
values leave the existing spread unchanged.
Sourcepub fn reverse(self, reverse: bool) -> ShimmerStyle
pub fn reverse(self, reverse: bool) -> ShimmerStyle
Set whether the highlight should move from right to left.
Sourcepub fn once(self, once: bool) -> ShimmerStyle
pub fn once(self, once: bool) -> ShimmerStyle
Set whether the highlight should complete one sweep instead of looping.
Trait Implementations§
Source§impl Clone for ShimmerStyle
impl Clone for ShimmerStyle
Source§fn clone(&self) -> ShimmerStyle
fn clone(&self) -> ShimmerStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ShimmerStyle
Source§impl Debug for ShimmerStyle
impl Debug for ShimmerStyle
Source§impl Default for ShimmerStyle
impl Default for ShimmerStyle
Source§fn default() -> ShimmerStyle
fn default() -> ShimmerStyle
Auto Trait Implementations§
impl Freeze for ShimmerStyle
impl RefUnwindSafe for ShimmerStyle
impl Send for ShimmerStyle
impl Sync for ShimmerStyle
impl Unpin for ShimmerStyle
impl UnsafeUnpin for ShimmerStyle
impl UnwindSafe for ShimmerStyle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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().