#[repr(C)]pub struct AngleValue {
pub metric: AngleMetric,
pub number: FloatValue,
}Expand description
FloatValue, but associated with a certain metric (i.e. deg, rad, etc.)
Fields§
§metric: AngleMetric§number: FloatValueImplementations§
Source§impl AngleValue
impl AngleValue
pub const fn zero() -> Self
pub const fn const_deg(value: isize) -> Self
pub const fn const_rad(value: isize) -> Self
pub const fn const_grad(value: isize) -> Self
pub const fn const_turn(value: isize) -> Self
pub fn const_percent(value: isize) -> Self
pub const fn const_from_metric(metric: AngleMetric, value: isize) -> Self
pub fn deg(value: f32) -> Self
pub fn rad(value: f32) -> Self
pub fn grad(value: f32) -> Self
pub fn turn(value: f32) -> Self
pub fn percent(value: f32) -> Self
pub fn from_metric(metric: AngleMetric, value: f32) -> Self
Sourcepub fn to_degrees(&self) -> f32
pub fn to_degrees(&self) -> f32
Convert to degrees, normalized to [0, 360) range.
Note: 360.0 becomes 0.0 due to modulo operation.
For conic gradients where 360.0 is meaningful, use to_degrees_raw().
Sourcepub fn to_degrees_raw(&self) -> f32
pub fn to_degrees_raw(&self) -> f32
Convert to degrees without normalization (raw value). Use this for conic gradients where 360.0 is a meaningful distinct value from 0.0.
Trait Implementations§
Source§impl Clone for AngleValue
impl Clone for AngleValue
Source§fn clone(&self) -> AngleValue
fn clone(&self) -> AngleValue
Returns a duplicate 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 AngleValue
impl Debug for AngleValue
Source§impl Default for AngleValue
impl Default for AngleValue
Source§fn default() -> AngleValue
fn default() -> AngleValue
Returns the “default value” for a type. Read more
Source§impl Display for AngleValue
impl Display for AngleValue
Source§impl Hash for AngleValue
impl Hash for AngleValue
Source§impl Ord for AngleValue
impl Ord for AngleValue
Source§fn cmp(&self, other: &AngleValue) -> Ordering
fn cmp(&self, other: &AngleValue) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for AngleValue
impl PartialEq for AngleValue
Source§impl PartialOrd for AngleValue
impl PartialOrd for AngleValue
Source§impl PrintAsCssValue for AngleValue
impl PrintAsCssValue for AngleValue
fn print_as_css_value(&self) -> String
impl Copy for AngleValue
impl Eq for AngleValue
impl StructuralPartialEq for AngleValue
Auto Trait Implementations§
impl Freeze for AngleValue
impl RefUnwindSafe for AngleValue
impl Send for AngleValue
impl Sync for AngleValue
impl Unpin for AngleValue
impl UnwindSafe for AngleValue
Blanket Implementations§
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