Expand description
A CSS <angle>
value.
Angles may be explicit or computed by calc()
, but are always stored and serialized
as their computed value.
Variants
Deg(CSSNumber)
An angle in degrees. There are 360 degrees in a full circle.
Rad(CSSNumber)
An angle in radians. There are 2π radians in a full circle.
Grad(CSSNumber)
An angle in gradians. There are 400 gradians in a full circle.
Turn(CSSNumber)
An angle in turns. There is 1 turn in a full circle.
Implementations
sourceimpl Angle
impl Angle
sourcepub fn to_radians(&self) -> CSSNumber
pub fn to_radians(&self) -> CSSNumber
Returns the angle in radians.
sourcepub fn to_degrees(&self) -> CSSNumber
pub fn to_degrees(&self) -> CSSNumber
Returns the angle in degrees.
Trait Implementations
sourceimpl<'i> Parse<'i> for Angle
impl<'i> Parse<'i> for Angle
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<Angle> for Angle
impl PartialEq<Angle> for Angle
sourceimpl PartialOrd<Angle> for Angle
impl PartialOrd<Angle> for Angle
sourcefn partial_cmp(&self, other: &Angle) -> Option<Ordering>
fn partial_cmp(&self, other: &Angle) -> 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 Sign for Angle
impl Sign for Angle
sourcefn is_sign_positive(&self) -> bool
fn is_sign_positive(&self) -> bool
Returns whether the value is positive.
sourcefn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Returns whether the value is negative.
sourceimpl ToCss for Angle
impl ToCss for Angle
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
sourceimpl TryFrom<Angle> for LengthValue
impl TryFrom<Angle> for LengthValue
sourceimpl TryFrom<Angle> for Percentage
impl TryFrom<Angle> for Percentage
Auto Trait Implementations
impl RefUnwindSafe for Angle
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnwindSafe for Angle
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
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
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
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> TryOp for T where
T: Op,
impl<T> TryOp for T where
T: Op,
sourceimpl<T> TrySign for T where
T: Sign,
impl<T> TrySign for T where
T: Sign,
sourcefn is_sign_positive(&self) -> bool
fn is_sign_positive(&self) -> bool
Returns whether the value is positive. If not possible, returns false.
sourcefn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Returns whether the value is negative. If not possible, returns false.