pub struct Angle { /* private fields */ }Expand description
Angle (dimensionless quantity).
Scalar storage of a quantity (f64 and AngleUnit).
Implementations§
Source§impl Angle
impl Angle
Sourcepub fn radian(value: f64) -> Self
pub fn radian(value: f64) -> Self
Create a new Angle with units of AngleUnit::radian.
Sourcepub fn revolution(value: f64) -> Self
pub fn revolution(value: f64) -> Self
Create a new Angle with units of AngleUnit::revolution.
Sourcepub fn degree(value: f64) -> Self
pub fn degree(value: f64) -> Self
Create a new Angle with units of AngleUnit::degree.
Sourcepub fn gon(value: f64) -> Self
pub fn gon(value: f64) -> Self
Create a new Angle with units of AngleUnit::gon.
Sourcepub fn mil(value: f64) -> Self
pub fn mil(value: f64) -> Self
Create a new Angle with units of AngleUnit::mil.
Sourcepub fn minute(value: f64) -> Self
pub fn minute(value: f64) -> Self
Create a new Angle with units of AngleUnit::minute.
Sourcepub fn second(value: f64) -> Self
pub fn second(value: f64) -> Self
Create a new Angle with units of AngleUnit::second.
Sourcepub fn definition(&self) -> UnitDefinition
pub fn definition(&self) -> UnitDefinition
Retrieve the UnitDefinition associated with this Angle.
Sourcepub fn to_radian(&self) -> Self
pub fn to_radian(&self) -> Self
Convert to AngleUnit::radian.
Sourcepub fn to_revolution(&self) -> Self
pub fn to_revolution(&self) -> Self
Convert to AngleUnit::revolution.
Sourcepub fn to_degree(&self) -> Self
pub fn to_degree(&self) -> Self
Convert to AngleUnit::degree.
Sourcepub fn to_gon(&self) -> Self
pub fn to_gon(&self) -> Self
Convert to AngleUnit::gon.
Sourcepub fn to_mil(&self) -> Self
pub fn to_mil(&self) -> Self
Convert to AngleUnit::mil.
Sourcepub fn to_minute(&self) -> Self
pub fn to_minute(&self) -> Self
Convert to AngleUnit::minute.
Sourcepub fn to_second(&self) -> Self
pub fn to_second(&self) -> Self
Convert to AngleUnit::second.
Trait Implementations§
Source§impl AddAssign<Quantity> for Angle
impl AddAssign<Quantity> for Angle
Source§fn add_assign(&mut self, rhs: Quantity)
fn add_assign(&mut self, rhs: Quantity)
Performs the
+= operation. Read moreSource§impl AddAssign for Angle
impl AddAssign for Angle
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<f64> for Angle
impl DivAssign<f64> for Angle
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl FixedQuantity<AngleUnit> for Angle
impl FixedQuantity<AngleUnit> for Angle
Source§fn convert(&self, unit: AngleUnit) -> Self
fn convert(&self, unit: AngleUnit) -> Self
Convert from this unit to another (creates a copy). No validation of base unit is made.
Source§fn convert_mut(&mut self, unit: AngleUnit)
fn convert_mut(&mut self, unit: AngleUnit)
Convert from this unit to another (modifies current quantity). No validation of base unit is made.
Source§fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>where
Self: Sized,
fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>where
Self: Sized,
Try to convert from this unit to another (creates a copy)
Source§impl From<Angle> for UnitDefinition
impl From<Angle> for UnitDefinition
Source§impl MulAssign<f64> for Angle
impl MulAssign<f64> for Angle
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl PartialOrd for Angle
impl PartialOrd for Angle
Source§impl SubAssign<Quantity> for Angle
impl SubAssign<Quantity> for Angle
Source§fn sub_assign(&mut self, rhs: Quantity)
fn sub_assign(&mut self, rhs: Quantity)
Performs the
-= operation. Read moreSource§impl SubAssign for Angle
impl SubAssign for Angle
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Angle
Auto Trait Implementations§
impl Freeze for Angle
impl RefUnwindSafe for Angle
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnwindSafe for Angle
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