pub struct BodyArtifact {
pub body: CelestialBody,
pub segments: Vec<Segment>,
pub frame: StoredFrame,
}Expand description
All segments for a single body.
Fields§
§body: CelestialBodyBody identifier.
segments: Vec<Segment>Time segments for the body.
frame: StoredFrameFrame the stored channels are expressed in.
Implementations§
Source§impl BodyArtifact
impl BodyArtifact
Sourcepub fn new(body: CelestialBody, segments: Vec<Segment>) -> Self
pub fn new(body: CelestialBody, segments: Vec<Segment>) -> Self
Creates a new geocentric body artifact (the default frame).
Sourcepub fn with_frame(
body: CelestialBody,
segments: Vec<Segment>,
frame: StoredFrame,
) -> Self
pub fn with_frame( body: CelestialBody, segments: Vec<Segment>, frame: StoredFrame, ) -> Self
Creates a body artifact with an explicit stored frame.
Sourcepub fn validate(&self) -> Result<(), CompressionError>
pub fn validate(&self) -> Result<(), CompressionError>
Validates the body’s segment metadata.
This checks each segment’s internal invariants, ensures that segments using the same time scale are ordered and non-overlapping, and rejects duplicate stored or residual channels before lookup or encoding.
Sourcepub fn summary_line(&self) -> String
pub fn summary_line(&self) -> String
Returns a compact one-line summary of the body’s segment coverage.
Sourcepub fn segment_at(&self, instant: Instant) -> Option<&Segment>
pub fn segment_at(&self, instant: Instant) -> Option<&Segment>
Returns the segment covering the requested instant, if any.
When two adjacent segments both include the same boundary instant, the later segment wins. This keeps shared segment edges deterministic for piecewise artifacts that use inclusive endpoints.