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<'de> Deserialize<'de> for Percentage
impl<'de> Deserialize<'de> for Percentage
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 JsonSchema for Percentage
impl JsonSchema for Percentage
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
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
This method tests for
self
and other
values to be equal, and is used
by ==
.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 Serialize for Percentage
impl Serialize 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 = _
Available on crate feature
visitor
only.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.
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.
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
Mutably borrows from an owned value. Read more
§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
source§impl<'i, T> ParseWithOptions<'i> for Twhere
T: Parse<'i>,
impl<'i, T> ParseWithOptions<'i> for Twhere T: Parse<'i>,
source§fn parse_with_options<'t>(
input: &mut Parser<'i, 't>,
_options: &ParserOptions<'_, '_>
) -> Result<T, ParseError<'i, ParserError<'i>>>
fn parse_with_options<'t>( input: &mut Parser<'i, 't>, _options: &ParserOptions<'_, '_> ) -> Result<T, ParseError<'i, ParserError<'i>>>
Parse a value of this type with the given options.
source§fn parse_string_with_options(
input: &'i str,
options: ParserOptions<'_, 'i>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_string_with_options( input: &'i str, options: ParserOptions<'_, 'i> ) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value from a string with the given options.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> TryOp for Twhere
T: Op,
impl<T> TryOp for Twhere T: Op,
source§impl<T> TrySign for Twhere
T: Sign,
impl<T> TrySign for Twhere T: Sign,
source§fn is_sign_positive(&self) -> bool
fn is_sign_positive(&self) -> bool
Returns whether the value is positive. If not possible, returns false.
source§fn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Returns whether the value is negative. If not possible, returns false.