pub struct Angle(/* private fields */);
Expand description
Represents an angle in degrees or radians.
Implementations§
source§impl Angle
impl Angle
sourcepub fn from_degrees(degrees: f32) -> Angle
pub fn from_degrees(degrees: f32) -> Angle
Creates a new angle from degrees.
sourcepub fn from_radians(radians: f32) -> Angle
pub fn from_radians(radians: f32) -> Angle
Creates a new angle from radians.
sourcepub fn from_gradians(gradians: f32) -> Angle
pub fn from_gradians(gradians: f32) -> Angle
Creates a new angle from gradians.
sourcepub fn from_turns(turns: f32) -> Angle
pub fn from_turns(turns: f32) -> Angle
Creates a new angle from turns.
sourcepub fn to_radians(self) -> f32
pub fn to_radians(self) -> f32
Returns the angle in radians.
sourcepub fn to_degrees(self) -> f32
pub fn to_degrees(self) -> f32
Returns the angle in degrees.
Trait Implementations§
impl Copy for Angle
impl StructuralPartialEq 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more