pub struct GradientRef(/* private fields */);Expand description
A Gradient held by value: what a Dart field or parameter typed Gradient becomes.
Clones share one gradient, as Dart’s references do, so a gradient handed on keeps its
identity. Two refs are equal when they share a gradient or when
eq_gradient says so, Dart’s ==.
Implementations§
Source§impl GradientRef
impl GradientRef
Sourcepub fn new(gradient: impl Gradient) -> GradientRef
pub fn new(gradient: impl Gradient) -> GradientRef
Erases a Gradient.
Sourcepub fn lerp(
a: Option<&GradientRef>,
b: Option<&GradientRef>,
t: f64,
) -> Option<GradientRef>
pub fn lerp( a: Option<&GradientRef>, b: Option<&GradientRef>, t: f64, ) -> Option<GradientRef>
Trait Implementations§
Source§impl Clone for GradientRef
impl Clone for GradientRef
Source§fn clone(&self) -> GradientRef
fn clone(&self) -> GradientRef
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 GradientRef
impl Debug for GradientRef
Source§impl Deref for GradientRef
impl Deref for GradientRef
Source§impl Display for GradientRef
Dart’s Gradient.toString, which the inner gradient’s Debug already renders.
impl Display for GradientRef
Dart’s Gradient.toString, which the inner gradient’s Debug already renders.
Source§impl<T> From<T> for GradientRefwhere
T: Gradient,
impl<T> From<T> for GradientRefwhere
T: Gradient,
Source§fn from(gradient: T) -> GradientRef
fn from(gradient: T) -> GradientRef
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for GradientRef
impl !Send for GradientRef
impl !Sync for GradientRef
impl !UnwindSafe for GradientRef
impl Forget for GradientRef
impl Freeze for GradientRef
impl Move for GradientRef
impl Unpin for GradientRef
impl UnsafeUnpin for GradientRefwhere
*const RcInner<dyn Gradient> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Gradient>>: UnsafeUnpin,
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