pub struct AnimationFrame { /* private fields */ }Expand description
One frame: its glyphs, and optionally its own colour and duration.
Implementations§
Source§impl AnimationFrame
impl AnimationFrame
Sourcepub fn new(ascii: impl Into<String>) -> Self
pub fn new(ascii: impl Into<String>) -> Self
A frame showing ascii in every glyph mode until unicode or
nerd give it other glyphs. Check glyphs from users with check_glyph;
a glyph wider than a cell is cut to one cell when drawn.
Sourcepub fn unicode(self, glyph: impl Into<String>) -> Self
pub fn unicode(self, glyph: impl Into<String>) -> Self
The glyph for Unicode terminals, and for Nerd Font terminals without a nerd glyph.
Sourcepub fn duration(self, duration: FrameTime) -> Self
pub fn duration(self, duration: FrameTime) -> Self
How long this frame is shown instead of the animation’s frame time.
Sourcepub fn glyph(&self, mode: GlyphMode) -> &str
pub fn glyph(&self, mode: GlyphMode) -> &str
The glyph drawn in mode, following the fallback nerd → unicode → ascii.
Sourcepub fn own_glyph(&self, mode: GlyphMode) -> Option<&str>
pub fn own_glyph(&self, mode: GlyphMode) -> Option<&str>
The glyph written for mode itself, without falling back.
Sourcepub fn frame_color(&self) -> Option<&CellColor>
pub fn frame_color(&self) -> Option<&CellColor>
The frame’s own colour, if it has one.
Sourcepub fn frame_duration(&self) -> Option<FrameTime>
pub fn frame_duration(&self) -> Option<FrameTime>
The frame’s own duration, if it has one.
Trait Implementations§
Source§impl Clone for AnimationFrame
impl Clone for AnimationFrame
Source§fn clone(&self) -> AnimationFrame
fn clone(&self) -> AnimationFrame
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 moreSource§impl Debug for AnimationFrame
impl Debug for AnimationFrame
impl Eq for AnimationFrame
Source§impl PartialEq for AnimationFrame
impl PartialEq for AnimationFrame
impl StructuralPartialEq for AnimationFrame
Auto Trait Implementations§
impl Freeze for AnimationFrame
impl RefUnwindSafe for AnimationFrame
impl Send for AnimationFrame
impl Sync for AnimationFrame
impl Unpin for AnimationFrame
impl UnsafeUnpin for AnimationFrame
impl UnwindSafe for AnimationFrame
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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