pub enum BrushRef<'a> {
Solid(Color),
Gradient(&'a Gradient),
Image(&'a Image),
}
Expand description
Reference to a brush.
This is useful for methods that would like to accept brushes by reference. Defining
the type as impl<Into<BrushRef>>
allows accepting types like &LinearGradient
directly without cloning or allocating.
Variants§
Solid(Color)
Solid color brush.
Gradient(&'a Gradient)
Gradient brush.
Image(&'a Image)
Image brush.
Implementations§
Trait Implementations§
impl<'a> Copy for BrushRef<'a>
impl<'a> StructuralPartialEq for BrushRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for BrushRef<'a>
impl<'a> !RefUnwindSafe for BrushRef<'a>
impl<'a> Send for BrushRef<'a>
impl<'a> Sync for BrushRef<'a>
impl<'a> Unpin for BrushRef<'a>
impl<'a> !UnwindSafe for BrushRef<'a>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)