Skip to main content

Motion

Struct Motion 

Source
pub struct Motion {
    pub animation: Animation,
    pub properties: MotionProps,
    pub restart: bool,
    pub delay: f32,
    pub lift: Option<Id>,
}
Expand description

applies an animation to selected layout properties

Fields§

§animation: Animation§properties: MotionProps§restart: bool

discards carried velocity when retargeting

§delay: f32

seconds to hold the current layout before moving toward a new one from rest ignored by zero duration animations

§lift: Option<Id>

while moving to a new parent or anchor, paints above everything under this target, which is ignored unless it was built before the node

Implementations§

Source§

impl Motion

Source

pub fn new(animation: impl Into<Animation>) -> Self

creates a new Motion

Source

pub fn animation(self, value: impl Into<Animation>) -> Self

Source

pub fn properties(self, value: MotionProps) -> Self

Source

pub fn restart(self, value: bool) -> Self

Source

pub fn delay(self, value: f32) -> Self

Source

pub fn lift(self, value: impl Into<Option<Id>>) -> Self

Source§

impl Motion

Source

pub fn resize(self) -> Self

animate during window resize instead of snapping to the new layout

Source

pub fn x(self) -> Self

Source

pub fn y(self) -> Self

Source

pub fn width(self) -> Self

Source

pub fn height(self) -> Self

Source

pub fn position(self) -> Self

Source

pub fn size(self) -> Self

Source

pub fn layout(self) -> Self

Trait Implementations§

Source§

impl Clone for Motion

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Motion

Source§

impl Debug for Motion

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Motion

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Motion

Auto Trait Implementations§

§

impl Forget for Motion

§

impl Freeze for Motion
where NonZero<u32>: Freeze,

§

impl Move for Motion

§

impl RefUnwindSafe for Motion

§

impl Send for Motion
where NonZero<u32>: Send,

§

impl Sync for Motion
where NonZero<u32>: Sync,

§

impl Unpin for Motion
where NonZero<u32>: Unpin,

§

impl UnsafeUnpin for Motion
where NonZeroU32Inner: UnsafeUnpin,

§

impl UnwindSafe for Motion

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.