Struct style::values::generics::size::Size
[−]
[src]
pub struct Size<L>(pub Size2D<L>);
A generic size, for border-*-radius
longhand properties, or
border-spacing
.
Methods
impl<L> Size<L>
[src]
pub fn new(width: L, height: L) -> Size<L>
[src]
Create a new Size
for an area of given width and height.
ⓘImportant traits for &'a mut Wpub fn width(&self) -> &L
[src]
Returns the width component.
ⓘImportant traits for &'a mut Wpub fn height(&self) -> &L
[src]
Returns the height component.
pub fn parse_with<'i, 't, F>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
parse_one: F
) -> Result<Self, ParseError<'i>> where
L: Clone,
F: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<L, ParseError<'i>>,
[src]
context: &ParserContext,
input: &mut Parser<'i, 't>,
parse_one: F
) -> Result<Self, ParseError<'i>> where
L: Clone,
F: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<L, ParseError<'i>>,
Parse a Size
with a given parsing function.
Trait Implementations
impl<L> Animate for Size<L> where
Size2D<L>: Animate,
[src]
Size2D<L>: Animate,
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>
[src]
Animate a value towards another one, given an animation procedure.
impl<L: Clone> Clone for Size<L>
[src]
fn clone(&self) -> Size<L>
[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<L> ComputeSquaredDistance for Size<L> where
Size2D<L>: ComputeSquaredDistance,
[src]
Size2D<L>: ComputeSquaredDistance,
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
[src]
Computes the squared distance between two animatable values.
impl<L: Copy> Copy for Size<L>
[src]
impl<L: Debug> Debug for Size<L>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<L> MallocSizeOf for Size<L> where
L: MallocSizeOf,
[src]
L: 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<L: PartialEq> PartialEq for Size<L>
[src]
fn eq(&self, __arg_0: &Size<L>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Size<L>) -> bool
[src]
This method tests for !=
.
impl<L> ToComputedValue for Size<L> where
Size2D<L>: ToComputedValue<ComputedValue = Size2D<<L as ToComputedValue>::ComputedValue>>,
L: ToComputedValue,
[src]
Size2D<L>: ToComputedValue<ComputedValue = Size2D<<L as ToComputedValue>::ComputedValue>>,
L: ToComputedValue,
type ComputedValue = Size<<L 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<L> ToCss for Size<L> where
L: ToCss + PartialEq,
[src]
L: ToCss + PartialEq,
fn to_css<W>(&self, dest: &mut W) -> Result where
W: Write,
[src]
W: Write,
Serialize self
in CSS syntax, writing to dest
.
fn to_css_string(&self) -> String
[src]
Serialize self
in CSS syntax and return a string. Read more
impl<L> ToAnimatedValue for Size<L> where
L: ToAnimatedValue,
[src]
L: ToAnimatedValue,
type AnimatedValue = Size<L::AnimatedValue>
The type of the animated value.
fn to_animated_value(self) -> Self::AnimatedValue
[src]
Converts this value to an animated value.
fn from_animated_value(animated: Self::AnimatedValue) -> Self
[src]
Converts back an animated value into a computed value.