Struct parcel_css::values::percentage::Percentage
source · [−]pub struct Percentage(pub CSSNumber);
Expand description
A CSS <percentage>
value.
Percentages may be explicit or computed by calc()
, but are always stored and serialized
as their computed value.
Tuple Fields
0: CSSNumber
Trait Implementations
sourceimpl Add<Percentage> for Percentage
impl Add<Percentage> for Percentage
type Output = Percentage
type Output = Percentage
The resulting type after applying the +
operator.
sourcefn add(self, other: Percentage) -> Percentage
fn add(self, other: Percentage) -> Percentage
Performs the +
operation. Read more
sourceimpl Clone for Percentage
impl Clone for Percentage
sourcefn clone(&self) -> Percentage
fn clone(&self) -> Percentage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Percentage
impl Debug for Percentage
sourceimpl From<Calc<Percentage>> for Percentage
impl From<Calc<Percentage>> for Percentage
sourcefn from(calc: Calc<Percentage>) -> Percentage
fn from(calc: Calc<Percentage>) -> Percentage
Converts to this type from the input type.
sourceimpl Into<Calc<Percentage>> for Percentage
impl Into<Calc<Percentage>> for Percentage
sourcefn into(self) -> Calc<Percentage>
fn into(self) -> Calc<Percentage>
Converts this type into the (usually inferred) input type.
sourceimpl Into<Percentage> for &FontStretchKeyword
impl Into<Percentage> for &FontStretchKeyword
sourcefn into(self) -> Percentage
fn into(self) -> Percentage
Converts this type into the (usually inferred) input type.
sourceimpl Into<Percentage> for &FontStretch
impl Into<Percentage> for &FontStretch
sourcefn into(self) -> Percentage
fn into(self) -> Percentage
Converts this type into the (usually inferred) input type.
sourceimpl Mul<f32> for Percentage
impl Mul<f32> for Percentage
type Output = Percentage
type Output = Percentage
The resulting type after applying the *
operator.
sourcefn mul(self, other: CSSNumber) -> Percentage
fn mul(self, other: CSSNumber) -> Percentage
Performs the *
operation. Read more
sourceimpl<'i> Parse<'i> for Percentage
impl<'i> Parse<'i> for Percentage
sourcefn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value of this type using an existing parser.
sourcefn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value from a string. Read more
sourceimpl PartialEq<Percentage> for Percentage
impl PartialEq<Percentage> for Percentage
sourcefn eq(&self, other: &Percentage) -> bool
fn eq(&self, other: &Percentage) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Percentage) -> bool
fn ne(&self, other: &Percentage) -> bool
This method tests for !=
.
sourceimpl PartialEq<f32> for Percentage
impl PartialEq<f32> for Percentage
sourceimpl PartialOrd<Percentage> for Percentage
impl PartialOrd<Percentage> for Percentage
sourcefn partial_cmp(&self, other: &Percentage) -> Option<Ordering>
fn partial_cmp(&self, other: &Percentage) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PartialOrd<f32> for Percentage
impl PartialOrd<f32> for Percentage
sourcefn partial_cmp(&self, other: &CSSNumber) -> Option<Ordering>
fn partial_cmp(&self, other: &CSSNumber) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ToCss for Percentage
impl ToCss for Percentage
sourcefn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError> where
W: Write,
fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError> where
W: Write,
Serialize self
in CSS syntax, writing to dest
.
sourcefn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
Serialize self
in CSS syntax and return a string. Read more
impl StructuralPartialEq for Percentage
Auto Trait Implementations
impl RefUnwindSafe for Percentage
impl Send for Percentage
impl Sync for Percentage
impl Unpin for Percentage
impl UnwindSafe for Percentage
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more