#[repr(C)]pub struct AngleValue {
pub metric: AngleMetric,
pub number: FloatValue,
}Expand description
FloatValue, but associated with a certain metric (i.e. px, em, etc.)
Fields§
§metric: AngleMetric§number: FloatValueImplementations§
Source§impl AngleValue
impl AngleValue
pub const fn zero() -> Self
Sourcepub const fn const_deg(value: isize) -> Self
pub const fn const_deg(value: isize) -> Self
Same as PixelValue::px(), but only accepts whole numbers,
since using f32 in const fn is not yet stabilized.
Sourcepub const fn const_rad(value: isize) -> Self
pub const fn const_rad(value: isize) -> Self
Same as PixelValue::em(), but only accepts whole numbers,
since using f32 in const fn is not yet stabilized.
Sourcepub const fn const_grad(value: isize) -> Self
pub const fn const_grad(value: isize) -> Self
Same as PixelValue::pt(), but only accepts whole numbers,
since using f32 in const fn is not yet stabilized.
Sourcepub const fn const_turn(value: isize) -> Self
pub const fn const_turn(value: isize) -> Self
Same as PixelValue::pt(), but only accepts whole numbers,
since using f32 in const fn is not yet stabilized.
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
Returns the value of the AngleMetric in degrees
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
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