pub struct ClockModel {
pub base: Scale,
pub reference: Dt,
pub drift: Drift,
}Expand description
A fully self-describing custom relativistic time scale.
Bundles a base Scale (Custom) with the quadratic
polynomial and reference epoch needed for exact conversion to any other scale
(typically TT or TDB).
Fields§
§base: ScaleBase scale (usually Custom)
reference: DtEpoch at which the polynomial was defined (e.g. last ground contact)
drift: DriftOffset
Implementations§
Source§impl ClockModel
impl ClockModel
Source§impl ClockModel
impl ClockModel
Sourcepub const WIRE_VERSION: u8 = 1
pub const WIRE_VERSION: u8 = 1
Current wire format version.
Sourcepub fn to_wire_bytes(&self) -> [u8; 70]
pub fn to_wire_bytes(&self) -> [u8; 70]
Serializes this self-describing ClockModel into a fixed buffer.
§Wire Format
- Byte
0: Version (WIRE_VERSION) - Byte
1:base(Scale) - Bytes
2..20:reference(Dt) - Bytes
20..71:drift(Drift)
Sourcepub fn from_wire_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_wire_bytes(bytes: &[u8]) -> Option<Self>
Deserializes a ClockModel from exactly WIRE_SIZE bytes of wire data.
Returns None if the version byte is unknown or any nested component
fails validation.
§Security
This function is safe to call with arbitrary untrusted data because:
- Fixed total size eliminates length-prefix vulnerabilities
- Validation is performed at every layer
- No allocation, no
unsafe, no possibility of code execution - Returns
Noneon any invalid or malicious input
Trait Implementations§
Source§impl Clone for ClockModel
impl Clone for ClockModel
Source§fn clone(&self) -> ClockModel
fn clone(&self) -> ClockModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClockModel
impl Debug for ClockModel
Source§impl<'de> Deserialize<'de> for ClockModel
impl<'de> Deserialize<'de> for ClockModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ClockModel
impl PartialEq for ClockModel
Source§fn eq(&self, other: &ClockModel) -> bool
fn eq(&self, other: &ClockModel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ClockModel
impl Serialize for ClockModel
Source§impl Tsify for ClockModel
impl Tsify for ClockModel
const DECL: &'static str = "/**\n * A fully self-describing custom relativistic time scale.\n *\n * Bundles a base `Scale` (`Custom`) with the quadratic\n * polynomial and reference epoch needed for exact conversion to any other scale\n * (typically TT or TDB).\n */\nexport interface ClockModel {\n /**\n * Base scale (usually `Custom`)\n */\n base: Scale;\n /**\n * Epoch at which the polynomial was defined (e.g. last ground contact)\n */\n reference: Dt;\n /**\n * Offset\n */\n drift: Drift;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
impl Copy for ClockModel
impl StructuralPartialEq for ClockModel
Auto Trait Implementations§
impl Freeze for ClockModel
impl RefUnwindSafe for ClockModel
impl Send for ClockModel
impl Sync for ClockModel
impl Unpin for ClockModel
impl UnsafeUnpin for ClockModel
impl UnwindSafe for ClockModel
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
Mutably borrows from an owned value. Read more