Skip to main content

Paint

Enum Paint 

Source
pub enum Paint<I = ImageBrush, G = Gradient, C = Arc<dyn Any + Send + Sync>> {
    Solid(Color),
    Gradient(G),
    Image(I),
    Resource(ImageBrush<ResourceId>),
    Custom(C),
}

Variants§

§

Solid(Color)

Solid color brush.

§

Gradient(G)

Gradient brush.

§

Image(I)

Image brush.

§

Resource(ImageBrush<ResourceId>)

Custom paint (referenced by ID)

§

Custom(C)

Custom paint (type erased as each backend will have their own)

Implementations§

Source§

impl Paint

Source

pub fn as_ref(&self) -> PaintRef<'_>

Trait Implementations§

Source§

impl<I: Clone, G: Clone, C: Clone> Clone for Paint<I, G, C>

Source§

fn clone(&self) -> Paint<I, G, C>

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<I: Debug, G: Debug, C: Debug> Debug for Paint<I, G, C>

Source§

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

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

impl<'a, I, C> From<&'a Gradient> for Paint<I, &'a Gradient, C>

Source§

fn from(value: &'a Gradient) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Paint> for PaintRef<'a>

Source§

fn from(paint: &'a Paint) -> Self

Converts to this type from the input type.
Source§

impl<I, G, C> From<AlphaColor<Srgb>> for Paint<I, G, C>

Source§

fn from(value: Color) -> Self

Converts to this type from the input type.
Source§

impl<I, G> From<Arc<dyn Any + Send + Sync>> for Paint<I, G, Arc<dyn Any + Send + Sync>>

Source§

fn from(value: Arc<dyn Any + Send + Sync>) -> Self

Converts to this type from the input type.
Source§

impl<'a, G, C> From<ImageBrush<&'a ImageData>> for Paint<ImageBrushRef<'a>, G, C>

Source§

fn from(value: ImageBrushRef<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Paint<ImageBrush<&'a ImageData>, &'a Gradient, &'a (dyn Any + Send + Sync + 'static)>> for BrushRef<'a>

Source§

fn from(value: PaintRef<'a>) -> Self

Converts to this type from the input type.
Source§

impl<I: PartialEq, G: PartialEq> PartialEq for Paint<I, G, Arc<dyn Any + Send + Sync>>

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

Auto Trait Implementations§

§

impl<I, G, C> Freeze for Paint<I, G, C>
where G: Freeze, I: Freeze, C: Freeze,

§

impl<I, G, C> RefUnwindSafe for Paint<I, G, C>

§

impl<I, G, C> Send for Paint<I, G, C>
where G: Send, I: Send, C: Send,

§

impl<I, G, C> Sync for Paint<I, G, C>
where G: Sync, I: Sync, C: Sync,

§

impl<I, G, C> Unpin for Paint<I, G, C>
where G: Unpin, I: Unpin, C: Unpin,

§

impl<I, G, C> UnsafeUnpin for Paint<I, G, C>

§

impl<I, G, C> UnwindSafe for Paint<I, G, C>
where G: UnwindSafe, I: UnwindSafe, C: UnwindSafe,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,