pub struct Segment {
pub start: Instant,
pub end: Instant,
pub channels: Vec<PolynomialChannel>,
pub residual_channels: Vec<PolynomialChannel>,
}Expand description
A single time segment for a specific body.
Fields§
§start: InstantInclusive segment start.
end: InstantInclusive segment end.
channels: Vec<PolynomialChannel>Quantized polynomial channels.
residual_channels: Vec<PolynomialChannel>Optional residual-correction channels layered on top of the base fit.
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn new(
start: Instant,
end: Instant,
channels: Vec<PolynomialChannel>,
) -> Self
pub fn new( start: Instant, end: Instant, channels: Vec<PolynomialChannel>, ) -> Self
Creates a new segment.
Sourcepub fn with_residual_channels(
start: Instant,
end: Instant,
channels: Vec<PolynomialChannel>,
residual_channels: Vec<PolynomialChannel>,
) -> Self
pub fn with_residual_channels( start: Instant, end: Instant, channels: Vec<PolynomialChannel>, residual_channels: Vec<PolynomialChannel>, ) -> Self
Creates a new segment with optional residual-correction channels.
Sourcepub fn validate(&self) -> Result<(), CompressionError>
pub fn validate(&self) -> Result<(), CompressionError>
Validates the segment metadata before the segment is stored or encoded.
Stored and residual channels must be unique and ordered canonically by channel kind so deterministic encoding stays stable across builders.
Sourcepub fn summary_line(&self) -> String
pub fn summary_line(&self) -> String
Returns a compact one-line summary of the segment span and channel mix.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Segment
impl<'de> Deserialize<'de> for Segment
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
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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