#[repr(C)]
pub enum GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> { Linear { direction: LineDirection, color_interpolation_method: ColorInterpolationMethod, items: OwnedSlice<GenericGradientItem<Color, LengthPercentage>>, flags: GradientFlags, compat_mode: GradientCompatMode, }, Radial { shape: GenericEndingShape<NonNegativeLength, NonNegativeLengthPercentage>, position: Position, color_interpolation_method: ColorInterpolationMethod, items: OwnedSlice<GenericGradientItem<Color, LengthPercentage>>, flags: GradientFlags, compat_mode: GradientCompatMode, }, Conic { angle: Angle, position: Position, color_interpolation_method: ColorInterpolationMethod, items: OwnedSlice<GenericGradientItem<Color, AngleOrPercentage>>, flags: GradientFlags, }, }
Expand description

Variants§

§

Linear

Fields

§direction: LineDirection

Line direction

§color_interpolation_method: ColorInterpolationMethod

Method to use for color interpolation.

§items: OwnedSlice<GenericGradientItem<Color, LengthPercentage>>

The color stops and interpolation hints.

§flags: GradientFlags

State flags for the gradient.

§compat_mode: GradientCompatMode

Compatibility mode.

A linear gradient.

§

Radial

Fields

§shape: GenericEndingShape<NonNegativeLength, NonNegativeLengthPercentage>

Shape of gradient

§position: Position

Center of gradient

§color_interpolation_method: ColorInterpolationMethod

Method to use for color interpolation.

§items: OwnedSlice<GenericGradientItem<Color, LengthPercentage>>

The color stops and interpolation hints.

§flags: GradientFlags

State flags for the gradient.

§compat_mode: GradientCompatMode

Compatibility mode.

A radial gradient.

§

Conic

Fields

§angle: Angle

Start angle of gradient

§position: Position

Center of gradient

§color_interpolation_method: ColorInterpolationMethod

Method to use for color interpolation.

§items: OwnedSlice<GenericGradientItem<Color, AngleOrPercentage>>

The color stops and interpolation hints.

§flags: GradientFlags

State flags for the gradient.

A conic gradient.

Implementations§

source§

impl GenericGradient<LineDirection, LengthPercentage, NonNegative<Length>, NonNegative<LengthPercentage>, GenericPosition<PositionComponent<HorizontalPositionKeyword>, PositionComponent<VerticalPositionKeyword>>, Angle, AngleOrPercentage, Color>

source

fn parse_webkit_gradient_argument<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't> ) -> Result<Self, ParseError<'i>>

source

fn parse_webkit_gradient_stops<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, reverse_stops: bool ) -> Result<OwnedSlice<GradientItem<Color, LengthPercentage>>, ParseError<'i>>

source

fn parse_stops<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't> ) -> Result<OwnedSlice<GradientItem<Color, LengthPercentage>>, ParseError<'i>>

Not used for -webkit-gradient syntax and conic-gradient

source

fn try_parse_color_interpolation_method<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't> ) -> Option<ColorInterpolationMethod>

Try to parse a color interpolation method.

source

fn parse_linear<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, repeating: bool, compat_mode: GradientCompatMode ) -> Result<Self, ParseError<'i>>

Parses a linear gradient. GradientCompatMode can change during -moz- prefixed gradient parsing if it come across a to keyword.

source

fn parse_radial<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, repeating: bool, compat_mode: GradientCompatMode ) -> Result<Self, ParseError<'i>>

Parses a radial gradient.

source

fn parse_conic<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, repeating: bool ) -> Result<Self, ParseError<'i>>

Parse a conic gradient.

Trait Implementations§

source§

impl<LineDirection: Clone, LengthPercentage: Clone, NonNegativeLength: Clone, NonNegativeLengthPercentage: Clone, Position: Clone, Angle: Clone, AngleOrPercentage: Clone, Color: Clone> Clone for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>

source§

fn clone( &self ) -> GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<LineDirection: Debug, LengthPercentage: Debug, NonNegativeLength: Debug, NonNegativeLengthPercentage: Debug, Position: Debug, Angle: Debug, AngleOrPercentage: Debug, Color: Debug> Debug for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>

source§

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

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

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> MallocSizeOf for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where LineDirection: MallocSizeOf, LengthPercentage: MallocSizeOf, NonNegativeLength: MallocSizeOf, NonNegativeLengthPercentage: MallocSizeOf, Position: MallocSizeOf, Angle: MallocSizeOf, AngleOrPercentage: MallocSizeOf, Color: MallocSizeOf,

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl<LineDirection: PartialEq, LengthPercentage: PartialEq, NonNegativeLength: PartialEq, NonNegativeLengthPercentage: PartialEq, Position: PartialEq, Angle: PartialEq, AngleOrPercentage: PartialEq, Color: PartialEq> PartialEq<GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>> for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>

source§

fn eq( &self, other: &GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToComputedValue for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where LineDirection: ToComputedValue, LengthPercentage: ToComputedValue, NonNegativeLength: ToComputedValue, NonNegativeLengthPercentage: ToComputedValue, Position: ToComputedValue, Angle: ToComputedValue, AngleOrPercentage: ToComputedValue, Color: ToComputedValue,

§

type ComputedValue = GenericGradient<<LineDirection as ToComputedValue>::ComputedValue, <LengthPercentage as ToComputedValue>::ComputedValue, <NonNegativeLength as ToComputedValue>::ComputedValue, <NonNegativeLengthPercentage as ToComputedValue>::ComputedValue, <Position as ToComputedValue>::ComputedValue, <Angle as ToComputedValue>::ComputedValue, <AngleOrPercentage as ToComputedValue>::ComputedValue, <Color as ToComputedValue>::ComputedValue>

The computed value type we’re going to be converted to.
source§

fn from_computed_value(from: &Self::ComputedValue) -> Self

Convert a computed value to specified value form. Read more
source§

fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue

Convert a specified value to a computed value, using itself and the data inside the Context.
source§

impl<D, LP, NL, NLP, P, A, AoP, C> ToCss for Gradient<D, LP, NL, NLP, P, A, AoP, C>where D: LineDirection, LP: ToCss, NL: ToCss, NLP: ToCss, P: PositionComponent + ToCss, A: ToCss + Zero, AoP: ToCss, C: ToCss,

source§

fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere W: Write,

Serialize self in CSS syntax, writing to dest.
source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
source§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToResolvedValue for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where LineDirection: ToResolvedValue, LengthPercentage: ToResolvedValue, NonNegativeLength: ToResolvedValue, NonNegativeLengthPercentage: ToResolvedValue, Position: ToResolvedValue, Angle: ToResolvedValue, AngleOrPercentage: ToResolvedValue, Color: ToResolvedValue,

§

type ResolvedValue = GenericGradient<<LineDirection as ToResolvedValue>::ResolvedValue, <LengthPercentage as ToResolvedValue>::ResolvedValue, <NonNegativeLength as ToResolvedValue>::ResolvedValue, <NonNegativeLengthPercentage as ToResolvedValue>::ResolvedValue, <Position as ToResolvedValue>::ResolvedValue, <Angle as ToResolvedValue>::ResolvedValue, <AngleOrPercentage as ToResolvedValue>::ResolvedValue, <Color as ToResolvedValue>::ResolvedValue>

The resolved value type we’re going to be converted to.
source§

fn from_resolved_value(from: Self::ResolvedValue) -> Self

Convert a resolved value to resolved value form.
source§

fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue

Convert a resolved value to a resolved value.
source§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToShmem for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where LineDirection: ToShmem, LengthPercentage: ToShmem, NonNegativeLength: ToShmem, NonNegativeLengthPercentage: ToShmem, Position: ToShmem, Angle: ToShmem, AngleOrPercentage: ToShmem, Color: ToShmem,

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
source§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> StructuralPartialEq for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>

Auto Trait Implementations§

§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> RefUnwindSafe for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where Angle: RefUnwindSafe, AngleOrPercentage: RefUnwindSafe, Color: RefUnwindSafe, LengthPercentage: RefUnwindSafe, LineDirection: RefUnwindSafe, NonNegativeLength: RefUnwindSafe, NonNegativeLengthPercentage: RefUnwindSafe, Position: RefUnwindSafe,

§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> Send for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where Angle: Send, AngleOrPercentage: Send, Color: Send, LengthPercentage: Send, LineDirection: Send, NonNegativeLength: Send, NonNegativeLengthPercentage: Send, Position: Send,

§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> Sync for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where Angle: Sync, AngleOrPercentage: Sync, Color: Sync, LengthPercentage: Sync, LineDirection: Sync, NonNegativeLength: Sync, NonNegativeLengthPercentage: Sync, Position: Sync,

§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> Unpin for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where Angle: Unpin, AngleOrPercentage: Unpin, Color: Unpin, LengthPercentage: Unpin, LineDirection: Unpin, NonNegativeLength: Unpin, NonNegativeLengthPercentage: Unpin, Position: Unpin,

§

impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> UnwindSafe for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where Angle: UnwindSafe, AngleOrPercentage: UnwindSafe + RefUnwindSafe, Color: UnwindSafe + RefUnwindSafe, LengthPercentage: UnwindSafe + RefUnwindSafe, LineDirection: UnwindSafe, NonNegativeLength: UnwindSafe, NonNegativeLengthPercentage: UnwindSafe, Position: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> MaybeBoxed<Box<T, Global>> for T

source§

fn maybe_boxed(self) -> Box<T, Global>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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