Skip to main content

DecorationRef

Struct DecorationRef 

Source
pub struct DecorationRef(/* private fields */);
Expand description

A Decoration held by value: what a Dart field or parameter typed Decoration becomes.

Clones share one decoration, as Dart’s references do, so a decoration handed on keeps its identity: a widget given the same decoration again sees an unchanged one. Two refs are equal when they share a decoration or when eq_decoration says so, Dart’s ==.

Implementations§

Source§

impl DecorationRef

Source

pub fn new(decoration: impl Decoration) -> DecorationRef

Erases a Decoration.

Source

pub fn lerp( a: Option<&DecorationRef>, b: Option<&DecorationRef>, t: f64, ) -> Option<DecorationRef>

Linearly interpolates between two Decorations.

This attempts to use lerp_from and lerp_to on b and a respectively to find a solution. If the two values can’t directly be interpolated, then the interpolation is done via null (at t == 0.5).

Trait Implementations§

Source§

impl Animatable<DecorationRef> for DecorationTween

Source§

fn transform(&self, _app: &App, t: f64) -> DecorationRef

Returns the value of the object at point t. Read more
Source§

fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> T
where Self: Sized,

The current value of this object for the given animation. Read more
Source§

fn animate( self, app: &mut App, parent: Retained<AnyAnimation<f64>>, ) -> Retained<AnyAnimation<T>>
where Self: Sized + Clone + 'static, T: 'static,

Returns a new animation that is driven by the given animation but that takes on values determined by this object. The new animation keeps parent; whoever keeps the result keeps both.
Source§

fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
where Self: Sized + Clone, P: Animatable<f64> + Clone,

Returns a new Animatable whose value is determined by first evaluating the given parent and then evaluating this object at the result.
Source§

impl Clone for DecorationRef

Source§

fn clone(&self) -> DecorationRef

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 Debug for DecorationRef

Source§

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

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

impl Deref for DecorationRef

Source§

type Target = dyn Decoration

The resulting type after dereferencing.
Source§

fn deref(&self) -> &(dyn Decoration + 'static)

Dereferences the value.
Source§

impl Display for DecorationRef

Dart’s Decoration.toString, which the inner decoration’s Debug already renders.

Source§

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

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

impl<T> From<T> for DecorationRef
where T: Decoration,

Source§

fn from(decoration: T) -> DecorationRef

Converts to this type from the input type.
Source§

impl PartialEq for DecorationRef

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl TweenValue for DecorationRef

Source§

fn same(&self, other: &DecorationRef) -> bool

Dart’s == between a widget’s target value and a tween endpoint.

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>