pub struct Keyframes { /* private fields */ }Expand description
A declared @keyframes rule.
The rule is injected lazily — constructing a Keyframes costs nothing, and
the stylesheet is only touched once something calls Keyframes::name,
Keyframes::ensure, or formats the handle with {}.
ⓘ
static FADE: Keyframes = Keyframes::new("app-fade", "from{opacity:0;}to{opacity:1;}");
// `Display` registers, so composed shorthands work without ceremony:
el.style("animation", &format!("{FADE} 600ms ease-out both"));Implementations§
Source§impl Keyframes
impl Keyframes
pub const fn new(name: &'static str, body: &'static str) -> Self
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Injects the rule if it has not been injected yet, then returns the CSS
keyframe name for use in an animation shorthand.
Sourcepub const fn name_unregistered(&self) -> &'static str
pub const fn name_unregistered(&self) -> &'static str
The keyframe name without injecting the rule.
Only useful in const contexts. If you are building an animation
value at runtime, use Keyframes::name or {} formatting instead so
the rule actually reaches the document.
pub const fn body(&self) -> &'static str
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Keyframes
impl RefUnwindSafe for Keyframes
impl Send for Keyframes
impl Sync for Keyframes
impl Unpin for Keyframes
impl UnsafeUnpin for Keyframes
impl UnwindSafe for Keyframes
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