pub struct Compass<T> { /* private fields */ }
Expand description
Represents a compass needle and the direction that it’s pointing
Implementations§
Source§impl<T> Compass<T>
impl<T> Compass<T>
Sourcepub const fn new_heading(
angle: Angle,
direction: RotationDirection,
reference: CompassReference,
) -> Compass<HeadingType>
pub const fn new_heading( angle: Angle, direction: RotationDirection, reference: CompassReference, ) -> Compass<HeadingType>
Creates a new heading type - see HeadingType
for details.
Sourcepub const fn new_track(
angle: Angle,
direction: RotationDirection,
reference: CompassReference,
) -> Compass<TrackType>
pub const fn new_track( angle: Angle, direction: RotationDirection, reference: CompassReference, ) -> Compass<TrackType>
Creates a new track type - see Track
for details.
Sourcepub const fn new_bearing(
angle: Angle,
direction: RotationDirection,
reference: CompassReference,
) -> Compass<BearingType>
pub const fn new_bearing( angle: Angle, direction: RotationDirection, reference: CompassReference, ) -> Compass<BearingType>
Creates a new bearing type - see Bearing
for details.
Sourcepub const fn new_course(
angle: Angle,
direction: RotationDirection,
reference: CompassReference,
) -> Compass<CourseType>
pub const fn new_course( angle: Angle, direction: RotationDirection, reference: CompassReference, ) -> Compass<CourseType>
Creates a new course type - see Course
for details.
Sourcepub const fn new_azimuth(
angle: Angle,
direction: RotationDirection,
reference: CompassReference,
) -> Compass<AzimuthType>
pub const fn new_azimuth( angle: Angle, direction: RotationDirection, reference: CompassReference, ) -> Compass<AzimuthType>
Creates a new azimuth type - see Azimuth
for details.
pub const fn angle(&self) -> &Angle
pub const fn direction(&self) -> &RotationDirection
pub const fn reference(&self) -> &CompassReference
pub fn as_direction_reference( &self, direction: RotationDirection, reference: CompassReference, ) -> Compass<T>
Source§impl Compass<HeadingType>
impl Compass<HeadingType>
Sourcepub fn relative_bearing(
self,
direction: RotationDirection,
offset: Angle,
) -> RelativeBearing
pub fn relative_bearing( self, direction: RotationDirection, offset: Angle, ) -> RelativeBearing
Converts this heading into a relative bearing using the specified offset and direction
Trait Implementations§
impl<T: Copy> Copy for Compass<T>
impl<T> StructuralPartialEq for Compass<T>
Auto Trait Implementations§
impl<T> Freeze for Compass<T>
impl<T> RefUnwindSafe for Compass<T>where
T: RefUnwindSafe,
impl<T> Send for Compass<T>where
T: Send,
impl<T> Sync for Compass<T>where
T: Sync,
impl<T> Unpin for Compass<T>where
T: Unpin,
impl<T> UnwindSafe for Compass<T>where
T: UnwindSafe,
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