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⁻¹
§impl Polynomial
impl Polynomial
pub fn py_from_constant_offset(
_cls: &Bound<'_, PyType>,
constant: Duration,
) -> Polynomial
pub fn py_from_constant_offset( _cls: &Bound<'_, PyType>, constant: Duration, ) -> Polynomial
Create a Polynomial structure that is only made of a static offset :type constant: Duration :rtype: Polynomial
pub fn py_from_constant_offset_nanoseconds(
_cls: &Bound<'_, PyType>,
nanos: f64,
) -> Polynomial
pub fn py_from_constant_offset_nanoseconds( _cls: &Bound<'_, PyType>, nanos: f64, ) -> Polynomial
Create a Polynomial structure from a static offset expressed in nanoseconds :type nanos: float :rtype: Polynomial
pub fn py_from_offset_and_rate(
_cls: &Bound<'_, PyType>,
constant: Duration,
rate: Duration,
) -> Polynomial
pub fn py_from_offset_and_rate( _cls: &Bound<'_, PyType>, constant: Duration, rate: Duration, ) -> Polynomial
Create a Polynomial structure from both static offset and rate of change: :type constant: Duration :type rate: Duration :rtype: Polynomial
pub fn py_from_offset_rate_nanoseconds(
_cls: &Bound<'_, PyType>,
offset_ns: f64,
drift_ns_s: f64,
) -> Polynomial
pub fn py_from_offset_rate_nanoseconds( _cls: &Bound<'_, PyType>, offset_ns: f64, drift_ns_s: f64, ) -> Polynomial
Create a Polynomial structure from a static offset and drift, in nanoseconds and nanoseconds.s⁻¹ :type offset_ns: float :type drift_ns_s: float :rtype: Polynomial
Trait Implementations§
§impl Clone for Polynomial
impl Clone for Polynomial
§fn clone(&self) -> Polynomial
fn clone(&self) -> Polynomial
1.0.0 (const: unstable) · 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<'py> IntoPyObject<'py> for Polynomial
impl<'py> IntoPyObject<'py> for Polynomial
§type Target = Polynomial
type Target = Polynomial
§type Output = Bound<'py, <Polynomial as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Polynomial as IntoPyObject<'py>>::Target>
§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Polynomial as IntoPyObject<'py>>::Output, <Polynomial as IntoPyObject<'py>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Polynomial as IntoPyObject<'py>>::Output, <Polynomial as IntoPyObject<'py>>::Error>
§impl Ord for Polynomial
impl Ord for Polynomial
§fn cmp(&self, other: &Polynomial) -> Ordering
fn cmp(&self, other: &Polynomial) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for Polynomial
impl PartialEq for Polynomial
§impl PartialOrd for Polynomial
impl PartialOrd for Polynomial
§impl PyClass for Polynomial
impl PyClass for Polynomial
§impl PyTypeInfo for Polynomial
impl PyTypeInfo for Polynomial
§const NAME: &'static str = <Self as ::pyo3::PyClass>::NAME
const NAME: &'static str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
§const MODULE: Option<&'static str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&'static str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.§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 DerefToPyAny 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 UnsafeUnpin 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
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<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more§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.