pub struct Coord<S: Scale, F: TimeFormat> { /* private fields */ }Expand description
A typed time coordinate on scale S in format F.
Coord<S, F> is an affine point. To shift it, add an Offset<S, F>.
To take the directed distance between two coordinates, subtract them.
Coord mirrors EncodedTime but is intentionally smaller in scope: it
only exposes raw-quantity access and affine arithmetic. The
EncodedTime API (to_time, to::<Target>(), …) is reachable through
the From/Into conversion below.
Implementations§
Source§impl<S: Scale, F: TimeFormat> Coord<S, F>
impl<S: Scale, F: TimeFormat> Coord<S, F>
Sourcepub const fn from_raw_unchecked(raw: Quantity<F::Unit>) -> Self
pub const fn from_raw_unchecked(raw: Quantity<F::Unit>) -> Self
Wrap a raw quantity without checking finiteness.
Provided for const contexts such as crate-level constants.
The caller is responsible for passing a finite value.
Trait Implementations§
Source§impl<S: Scale, F: TimeFormat> From<Coord<S, F>> for EncodedTime<S, F>
impl<S: Scale, F: TimeFormat> From<Coord<S, F>> for EncodedTime<S, F>
Source§impl<S: Scale, F: TimeFormat> From<EncodedTime<S, F>> for Coord<S, F>
impl<S: Scale, F: TimeFormat> From<EncodedTime<S, F>> for Coord<S, F>
Source§fn from(value: EncodedTime<S, F>) -> Self
fn from(value: EncodedTime<S, F>) -> Self
Converts to this type from the input type.
Source§impl<S: Scale, F: TimeFormat> PartialOrd for Coord<S, F>
impl<S: Scale, F: TimeFormat> PartialOrd for Coord<S, F>
impl<S: Scale, F: TimeFormat> Copy for Coord<S, F>
Auto Trait Implementations§
impl<S, F> Freeze for Coord<S, F>
impl<S, F> RefUnwindSafe for Coord<S, F>
impl<S, F> Send for Coord<S, F>
impl<S, F> Sync for Coord<S, F>
impl<S, F> Unpin for Coord<S, F>
impl<S, F> UnsafeUnpin for Coord<S, F>
impl<S, F> UnwindSafe for Coord<S, F>
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