Skip to main content

Modified

Struct Modified 

Source
pub struct Modified<O, M> {
    pub observable: O,
    pub modifier: M,
}
Expand description

An observable decorated with one correction — itself an observable, which is what makes the chain compose.

The sum is taken in application order. Floating-point addition is not associative, so the order a caller writes the chain in is the order it is summed in, and a chain reproduces a hand-written composition of the same terms in the same order to the bit.

Fields§

§observable: O

The decorated observable.

§modifier: M

The correction applied to it.

Implementations§

Source§

impl<O, M> Modified<O, M>

Source

pub const fn new(observable: O, modifier: M) -> Self

Decorate observable with one correction.

Source

pub const fn with<N>(self, modifier: N) -> Modified<Self, N>

Add one more correction to the chain, applied after the ones already in it.

Chaining lives here rather than on Observable so that a chain can be built without naming K: every observable and every modifier in this module is written for all K, so a method on the trait would be ambiguous at the point it is called and would have to be turbofished. Assembled this way, K is fixed once — where the chain meets the parameter vector it is evaluated at.

Trait Implementations§

Source§

impl<O: Clone, M: Clone> Clone for Modified<O, M>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<O: Copy, M: Copy> Copy for Modified<O, M>

Source§

impl<O: Debug, M: Debug> Debug for Modified<O, M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const K: usize, O: Observable<K>, M: Modifier<K>> Observable<K> for Modified<O, M>

Source§

fn value<S: Scalar>(&self, satellite: &[S; 6], parameters: &[S; K]) -> S

The observable’s value at this state and these parameters.
Source§

impl<O: PartialEq, M: PartialEq> PartialEq for Modified<O, M>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<O: PartialEq, M: PartialEq> StructuralPartialEq for Modified<O, M>

Auto Trait Implementations§

§

impl<O, M> Freeze for Modified<O, M>
where O: Freeze, M: Freeze,

§

impl<O, M> RefUnwindSafe for Modified<O, M>

§

impl<O, M> Send for Modified<O, M>
where O: Send, M: Send,

§

impl<O, M> Sync for Modified<O, M>
where O: Sync, M: Sync,

§

impl<O, M> Unpin for Modified<O, M>
where O: Unpin, M: Unpin,

§

impl<O, M> UnsafeUnpin for Modified<O, M>
where O: UnsafeUnpin, M: UnsafeUnpin,

§

impl<O, M> UnwindSafe for Modified<O, M>
where O: UnwindSafe, M: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 = !

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.