Struct Polynomial
pub struct Polynomial {
pub constant: Duration,
pub rate: Duration,
pub accel: Duration,
}Expand description
Interpolation Polynomial used for example in [TimeScale] maintenance, precise monitoring or conversions.
Fields§
§constant: DurationConstant offset Duration, regardless of the interpolation interval
rate: DurationRate or drift in seconds per second (s.s⁻¹) expressed as Duration for convenience. It is a linear scaling factor of the interpolation interval.
accel: DurationAcceleration or drift change in s.s⁻², expressed as Duration for convenience. It is a quadratic scaling of the interpolation interval.
Implementations§
§impl Polynomial
impl Polynomial
pub fn correction_duration(&self, time_interval: Duration) -> Duration
pub fn correction_duration(&self, time_interval: Duration) -> Duration
§impl Polynomial
impl Polynomial
pub fn from_constant_offset(constant: Duration) -> Polynomial
pub fn from_constant_offset(constant: Duration) -> Polynomial
Create a Polynomial structure that is only made of a static offset
pub fn from_constant_offset_nanoseconds(nanos: f64) -> Polynomial
pub fn from_constant_offset_nanoseconds(nanos: f64) -> Polynomial
Create a Polynomial structure from a static offset expressed in nanoseconds
pub fn from_offset_and_rate(constant: Duration, rate: Duration) -> Polynomial
pub fn from_offset_and_rate(constant: Duration, rate: Duration) -> Polynomial
Create a Polynomial structure from both static offset and rate of change:
pub fn from_offset_rate_nanoseconds(
offset_ns: f64,
drift_ns_s: f64,
) -> Polynomial
pub fn from_offset_rate_nanoseconds( offset_ns: f64, drift_ns_s: f64, ) -> Polynomial
Create a Polynomial structure from a static offset and drift, in nanoseconds and nanoseconds.s⁻¹
Trait Implementations§
§impl Clone for Polynomial
impl Clone for Polynomial
§fn clone(&self) -> Polynomial
fn clone(&self) -> Polynomial
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for Polynomial
impl Debug for Polynomial
§impl<'de> Deserialize<'de> for Polynomial
impl<'de> Deserialize<'de> for Polynomial
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Polynomial, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Polynomial, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for Polynomial
impl Display for Polynomial
§impl From<(f64, f64, f64)> for Polynomial
impl From<(f64, f64, f64)> for Polynomial
§fn from(triplet: (f64, f64, f64)) -> Polynomial
fn from(triplet: (f64, f64, f64)) -> Polynomial
Converts (f64, f64, f64) triplet, oftentimes noted (a0, a1, a2) as (offset (s), drift (s.s⁻¹), drift change (s.s⁻²)) to Polynomial structure, that allows precise [TimeScale] translation.
§impl Hash for Polynomial
impl Hash for Polynomial
§impl Ord for Polynomial
impl Ord for Polynomial
§impl PartialEq for Polynomial
impl PartialEq for Polynomial
§impl PartialOrd for Polynomial
impl PartialOrd for Polynomial
§impl Serialize for Polynomial
impl Serialize for Polynomial
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Polynomial
impl Eq for Polynomial
impl StructuralPartialEq for Polynomial
Auto Trait Implementations§
impl Freeze for Polynomial
impl RefUnwindSafe for Polynomial
impl Send for Polynomial
impl Sync for Polynomial
impl Unpin for Polynomial
impl UnwindSafe for Polynomial
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromDhall for Twhere
T: DeserializeOwned,
impl<T> FromDhall for Twhere
T: DeserializeOwned,
fn from_dhall(v: &Value) -> Result<T, Error>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.