Struct style::values::generics::rect::Rect
[−]
[src]
pub struct Rect<T>(pub T, pub T, pub T, pub T);
A CSS value made of four components, where its ToCss
impl will try to
serialize as few components as possible, like for example in border-width
.
Methods
impl<T> Rect<T>
[src]
impl<T> Rect<T> where
T: Clone,
[src]
T: Clone,
pub fn all(v: T) -> Self
[src]
Returns a rect with all the values equal to v
.
pub fn parse_with<'i, 't, Parse>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
parse: Parse
) -> Result<Self, ParseError<'i>> where
Parse: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<T, ParseError<'i>>,
[src]
context: &ParserContext,
input: &mut Parser<'i, 't>,
parse: Parse
) -> Result<Self, ParseError<'i>> where
Parse: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<T, ParseError<'i>>,
Parses a new Rect<T>
value with the given parse function.
Trait Implementations
impl<T> Animate for Rect<T> where
T: Animate,
[src]
T: Animate,
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>
[src]
Animate a value towards another one, given an animation procedure.
impl<T: Clone> Clone for Rect<T>
[src]
fn clone(&self) -> Rect<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> ComputeSquaredDistance for Rect<T> where
T: ComputeSquaredDistance,
[src]
T: ComputeSquaredDistance,
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
[src]
Computes the squared distance between two animatable values.
impl<T: Copy> Copy for Rect<T>
[src]
impl<T: Debug> Debug for Rect<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T> MallocSizeOf for Rect<T> where
T: MallocSizeOf,
[src]
T: MallocSizeOf,
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
impl<T: PartialEq> PartialEq for Rect<T>
[src]
fn eq(&self, __arg_0: &Rect<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Rect<T>) -> bool
[src]
This method tests for !=
.
impl<T> ToComputedValue for Rect<T> where
T: ToComputedValue,
[src]
T: ToComputedValue,
type ComputedValue = Rect<<T as ToComputedValue>::ComputedValue>
The computed value type we're going to be converted to.
fn to_computed_value(&self, context: &Context) -> Self::ComputedValue
[src]
Convert a specified value to a computed value, using itself and the data inside the Context
. Read more
fn from_computed_value(computed: &Self::ComputedValue) -> Self
[src]
Convert a computed value to specified value form. Read more
impl<T> Parse for Rect<T> where
T: Clone + Parse,
[src]
T: Clone + Parse,
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i>>
[src]
context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i>>
Parse a value of this type. Read more
impl<T> ToCss for Rect<T> where
T: PartialEq + ToCss,
[src]
T: PartialEq + ToCss,