Struct lightningcss::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§
source§impl Add<Percentage> for Percentage
impl Add<Percentage> for Percentage
source§impl Clone for Percentage
impl Clone for Percentage
source§fn clone(&self) -> Percentage
fn clone(&self) -> Percentage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Percentage
impl Debug for Percentage
source§impl From<Calc<Percentage>> for Percentage
impl From<Calc<Percentage>> for Percentage
source§fn from(calc: Calc<Percentage>) -> Percentage
fn from(calc: Calc<Percentage>) -> Percentage
Converts to this type from the input type.
source§impl Into<Calc<Percentage>> for Percentage
impl Into<Calc<Percentage>> for Percentage
source§fn into(self) -> Calc<Percentage>
fn into(self) -> Calc<Percentage>
Converts this type into the (usually inferred) input type.
source§impl Into<Percentage> for &FontStretch
impl Into<Percentage> for &FontStretch
source§fn into(self) -> Percentage
fn into(self) -> Percentage
Converts this type into the (usually inferred) input type.
source§impl Into<Percentage> for &FontStretchKeyword
impl Into<Percentage> for &FontStretchKeyword
source§fn into(self) -> Percentage
fn into(self) -> Percentage
Converts this type into the (usually inferred) input type.
source§impl Mul<f32> for Percentage
impl Mul<f32> for Percentage
§type Output = Percentage
type Output = Percentage
The resulting type after applying the
*
operator.source§impl Op for Percentage
impl Op for Percentage
source§impl<'i> Parse<'i> for Percentage
impl<'i> Parse<'i> for Percentage
source§fn 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.
source§fn 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
source§impl PartialEq<Percentage> for Percentage
impl PartialEq<Percentage> for Percentage
source§fn eq(&self, other: &Percentage) -> bool
fn eq(&self, other: &Percentage) -> bool
source§impl PartialOrd<Percentage> for Percentage
impl PartialOrd<Percentage> for Percentage
source§fn partial_cmp(&self, other: &Percentage) -> Option<Ordering>
fn partial_cmp(&self, other: &Percentage) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl Rem<Percentage> for Percentage
impl Rem<Percentage> for Percentage
source§impl Sign for Percentage
impl Sign for Percentage
source§impl ToCss for Percentage
impl ToCss for Percentage
source§fn 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
.source§fn 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 moresource§impl TryFrom<Angle> for Percentage
impl TryFrom<Angle> for Percentage
source§impl TryMap for Percentage
impl TryMap for Percentage
source§impl<'i, __T: Visit<'i, __T, __V>, __V: Visitor<'i, __T>> Visit<'i, __T, __V> for Percentage
impl<'i, __T: Visit<'i, __T, __V>, __V: Visitor<'i, __T>> Visit<'i, __T, __V> for Percentage
source§const CHILD_TYPES: VisitTypes = _
const CHILD_TYPES: VisitTypes = _
The types of values contained within this value and its children.
This is used to skip branches that don’t have any values requested
by the Visitor. Read more
source§fn visit_children(&mut self, visitor: &mut __V)
fn visit_children(&mut self, visitor: &mut __V)
Visit the children of this value.
source§impl Zero for Percentage
impl Zero for Percentage
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.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer