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 duration(self, duration: Duration) -> Self
pub fn duration(self, duration: Duration) -> Self
Set the duration of one complete sweep.
A zero duration is clamped to one millisecond.
Sourcepub fn highlight_color(self, color: impl Into<Hsla>) -> Self
pub fn highlight_color(self, color: impl Into<Hsla>) -> Self
Replace the theme-aware highlight with an explicit color.
Sourcepub fn spread(self, spread: impl Into<ShimmerSpread>) -> Self
pub fn spread(self, spread: impl Into<ShimmerSpread>) -> Self
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.
Trait Implementations§
Source§impl Clone for ShimmerStyle
impl Clone for ShimmerStyle
Source§fn clone(&self) -> ShimmerStyle
fn clone(&self) -> ShimmerStyle
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 moreimpl Copy for ShimmerStyle
Source§impl Debug for ShimmerStyle
impl Debug for 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().