#[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
A CSS gradient. https://drafts.csswg.org/css-images/#gradients
Variants§
Linear
A linear gradient.
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.
Radial
A radial gradient.
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.
Conic
A conic gradient.
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.
Implementations§
source§impl GenericGradient<LineDirection, LengthPercentage, NonNegative<Length>, NonNegative<LengthPercentage>, GenericPosition<PositionComponent<HorizontalPositionKeyword>, PositionComponent<VerticalPositionKeyword>>, Angle, AngleOrPercentage, Color>
impl GenericGradient<LineDirection, LengthPercentage, NonNegative<Length>, NonNegative<LengthPercentage>, GenericPosition<PositionComponent<HorizontalPositionKeyword>, PositionComponent<VerticalPositionKeyword>>, Angle, AngleOrPercentage, Color>
fn parse_webkit_gradient_argument<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
fn parse_webkit_gradient_stops<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, reverse_stops: bool, ) -> Result<OwnedSlice<GradientItem<Color, LengthPercentage>>, ParseError<'i>>
sourcefn parse_stops<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<OwnedSlice<GradientItem<Color, LengthPercentage>>, ParseError<'i>>
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
sourcefn try_parse_color_interpolation_method<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Option<ColorInterpolationMethod>
fn try_parse_color_interpolation_method<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Option<ColorInterpolationMethod>
Try to parse a color interpolation method.
sourcefn parse_linear<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
repeating: bool,
compat_mode: GradientCompatMode,
) -> Result<Self, ParseError<'i>>
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.
sourcefn parse_radial<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
repeating: bool,
compat_mode: GradientCompatMode,
) -> Result<Self, ParseError<'i>>
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.
sourcefn parse_conic<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
repeating: bool,
) -> Result<Self, ParseError<'i>>
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>
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>
fn clone( &self, ) -> GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§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>
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§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,
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
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<LineDirection: PartialEq, LengthPercentage: PartialEq, NonNegativeLength: PartialEq, NonNegativeLengthPercentage: PartialEq, Position: PartialEq, Angle: PartialEq, AngleOrPercentage: PartialEq, Color: PartialEq> PartialEq for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection: PartialEq, LengthPercentage: PartialEq, NonNegativeLength: PartialEq, NonNegativeLengthPercentage: PartialEq, Position: PartialEq, Angle: PartialEq, AngleOrPercentage: PartialEq, Color: PartialEq> PartialEq 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
fn eq( &self, other: &GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>, ) -> bool
self
and other
values to be equal, and is used by ==
.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,
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,
source§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>
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>
source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
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,
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§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,
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,
source§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>
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>
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
source§impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToShmem for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> ToShmem for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
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> Freeze for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> RefUnwindSafe for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: RefUnwindSafe,
Position: RefUnwindSafe,
Angle: RefUnwindSafe,
NonNegativeLength: RefUnwindSafe,
NonNegativeLengthPercentage: RefUnwindSafe,
Color: RefUnwindSafe,
LengthPercentage: RefUnwindSafe,
AngleOrPercentage: RefUnwindSafe,
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> Send for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> Sync for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> Unpin for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>
impl<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color> UnwindSafe for GenericGradient<LineDirection, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage, Position, Angle, AngleOrPercentage, Color>where
LineDirection: UnwindSafe,
Position: UnwindSafe,
Angle: UnwindSafe,
NonNegativeLength: UnwindSafe,
NonNegativeLengthPercentage: UnwindSafe,
Color: RefUnwindSafe + UnwindSafe,
LengthPercentage: RefUnwindSafe + UnwindSafe,
AngleOrPercentage: RefUnwindSafe + UnwindSafe,
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
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)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more