GetterFromHistory

Struct GetterFromHistory 

Source
pub struct GetterFromHistory<'a, G, TG: TimeGetter<E>, E: Copy + Debug> { /* private fields */ }
Expand description

As histories return values at times, we can ask them to return values at the time of now or now with a delta. This makes that much easier and is the recommended way of following MotionProfiles.

Implementations§

Source§

impl<'a, G, TG: TimeGetter<E>, E: Copy + Debug> GetterFromHistory<'a, G, TG, E>

Source

pub fn new_no_delta( history: &'a mut impl History<G, E>, time_getter: Reference<TG>, ) -> Self

Constructor such that the time in the request to the history will be directly that returned from the TimeGetter with no delta.

Source

pub fn new_start_at_zero( history: &'a mut impl History<G, E>, time_getter: Reference<TG>, ) -> Result<Self, Error<E>>

Constructor such that the times requested from the History will begin at zero where zero is the moment this constructor is called.

Source

pub fn new_custom_start( history: &'a mut impl History<G, E>, time_getter: Reference<TG>, start: Time, ) -> Result<Self, Error<E>>

Constructor such that the times requested from the History will start at a given time with that time defined as the moment of construction.

Source

pub fn new_custom_delta( history: &'a mut impl History<G, E>, time_getter: Reference<TG>, time_delta: Time, ) -> Self

Constructor with a custom time delta.

Source

pub fn set_delta(&mut self, time_delta: Time)

Set the time delta.

Source

pub fn set_time(&mut self, time: Time) -> NothingOrError<E>

Define now as a given time in the history. Mostly used when construction and use are far apart in time.

Trait Implementations§

Source§

impl<G, TG: TimeGetter<E>, E: Copy + Debug> Getter<G, E> for GetterFromHistory<'_, G, TG, E>

Source§

fn get(&self) -> Output<G, E>

Get something.
Source§

impl<G, TG: TimeGetter<E>, E: Copy + Debug> Updatable<E> for GetterFromHistory<'_, G, TG, E>

Source§

fn update(&mut self) -> NothingOrError<E>

As this trait is very generic, exactly what this does will be very dependent on the implementor.

Auto Trait Implementations§

§

impl<'a, G, TG, E> Freeze for GetterFromHistory<'a, G, TG, E>

§

impl<'a, G, TG, E> !RefUnwindSafe for GetterFromHistory<'a, G, TG, E>

§

impl<'a, G, TG, E> !Send for GetterFromHistory<'a, G, TG, E>

§

impl<'a, G, TG, E> !Sync for GetterFromHistory<'a, G, TG, E>

§

impl<'a, G, TG, E> Unpin for GetterFromHistory<'a, G, TG, E>

§

impl<'a, G, TG, E> !UnwindSafe for GetterFromHistory<'a, G, TG, E>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.