Skip to main content

WithEngine

Struct WithEngine 

Source
pub struct WithEngine<'a, T, Ctx> { /* private fields */ }
Expand description

A wrapper that pairs a coordinate reference with a custom transform context, enabling .using(&engine).to_frame::<F2>(&jd) style calls.

§Example

ⓘ
let engine = AstroContext::new();
let result = direction.using(&engine).to_frame::<EclipticMeanJ2000>(&jd);

Implementations§

Source§

impl<'a, F: ReferenceFrame, Ctx> WithEngine<'a, Direction<F>, Ctx>
where Ctx: TransformContext,

Source

pub fn to_frame<F2: ReferenceFrame>(&self, jd: &JulianDate) -> Direction<F2>
where (): FrameRotationProvider<F, F2>,

Rotates this direction to a new reference frame using the wrapped context.

Source§

impl<'a, C, F, U, Ctx> WithEngine<'a, Position<C, F, U>, Ctx>
where C: ReferenceCenter<Params = ()>, Ctx: TransformContext, Ctx::Eph: Ephemeris, F: ReferenceFrame, U: LengthUnit,

Source

pub fn to_frame<F2: ReferenceFrame>( &self, jd: &JulianDate, ) -> Position<C, F2, U>
where (): FrameRotationProvider<F, F2>,

Rotates this position to a new reference frame using the wrapped context.

Source

pub fn to_center<C2: ReferenceCenter<Params = ()>>( &self, jd: &JulianDate, ) -> Position<C2, F, U>
where (): CenterShiftProvider<C, C2, F>,

Translates this position to a new reference center using the wrapped context.

Source

pub fn to<C2: ReferenceCenter<Params = ()>, F2: ReferenceFrame>( &self, jd: &JulianDate, ) -> Position<C2, F2, U>
where (): CenterShiftProvider<C, C2, F> + FrameRotationProvider<F, F2>,

Combined center + frame transform using the wrapped context.

Auto Trait Implementations§

§

impl<'a, T, Ctx> Freeze for WithEngine<'a, T, Ctx>

§

impl<'a, T, Ctx> RefUnwindSafe for WithEngine<'a, T, Ctx>

§

impl<'a, T, Ctx> Send for WithEngine<'a, T, Ctx>

§

impl<'a, T, Ctx> Sync for WithEngine<'a, T, Ctx>

§

impl<'a, T, Ctx> Unpin for WithEngine<'a, T, Ctx>

§

impl<'a, T, Ctx> UnsafeUnpin for WithEngine<'a, T, Ctx>

§

impl<'a, T, Ctx> UnwindSafe for WithEngine<'a, T, Ctx>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UsingEngine for T

Source§

fn using<'a, Ctx>(&'a self, engine: &'a Ctx) -> WithEngine<'a, Self, Ctx>
where Ctx: TransformContext,

Wrap this coordinate with a custom transform context for the next transformation call.