pub struct CRFileSummary {Show 13 fields
pub version: u8,
pub run_id: u32,
pub subrun: u64,
pub n_frames: u32,
pub min_evid: u32,
pub max_evid: u32,
pub first_gcutime: f64,
pub last_gcutime: f64,
pub first_gpstime: f64,
pub last_gpstime: f64,
pub data_sources: Vec<GapsDataSource>,
pub missing_evid: Vec<(u32, u32)>,
pub footer_len: u64,
}Expand description
Meta information about a whole caraspace file.
The summary is stored in the last frame of a file (the “footer”), so that it can be written when the file is closed, without going back to the beginning of the file.
Every file with a footer ends with the same 18 bytes:
magic (4) | footer_len (8) | TAIL (2) | CRFrameObject TAIL (2) | CRFrame TAIL (2)
so the footer can be found by reading the last 18 bytes of a file and jumping back footer_len bytes.
Fields§
§version: u8The version of the summary, needs to be compatible with CRReader/Writer
run_id: u32Run id of the frames in this file
subrun: u64Subrun id (number of the file within the run)
n_frames: u32Number of frames in this file, including empty frames, but without the footer frame itself
min_evid: u32Smallest event id in this file (only meaningful if n_frames > 0)
max_evid: u32Largest event id in this file (only meaningful if n_frames > 0)
first_gcutime: f64GCU time of the first frame with a timestamp (0 if there is none)
last_gcutime: f64GCU time of the last frame with a timestamp (0 if there is none)
first_gpstime: f64GPS time of the first frame with a GPS timestamp (0 if there is none)
last_gpstime: f64GPS time of the last frame with a GPS timestamp (0 if there is none)
data_sources: Vec<GapsDataSource>All data sources which appear in the frames of this file
missing_evid: Vec<(u32, u32)>Clusters of missing event ids, filled by empty frames: (first missing event id, number of missing ids)
Size of the whole footer frame in bytes. Set when the footer is created (see to_footer)
Implementations§
Source§impl CRFileSummary
impl CRFileSummary
Sourcepub const TRAILER_SIZE: usize
pub const TRAILER_SIZE: usize
The last bytes of a file with a footer: magic, footer_len and three tails
pub fn new() -> Self
The complete footer frame, ready to be appended to a file. footer_len is set to its size.
Trait Implementations§
Source§impl Clone for CRFileSummary
impl Clone for CRFileSummary
Source§impl Debug for CRFileSummary
impl Debug for CRFileSummary
Source§impl Default for CRFileSummary
impl Default for CRFileSummary
Source§impl Display for CRFileSummary
impl Display for CRFileSummary
Source§impl Frameable for CRFileSummary
impl Frameable for CRFileSummary
const CRFRAMEOBJECT_TYPE: CRFrameObjectType = CRFrameObjectType::CRFileSummary
Source§fn pack(&self) -> CRFrameObjectwhere
Self: Serialization,
fn pack(&self) -> CRFrameObjectwhere
Self: Serialization,
Source§impl FromRandom for CRFileSummary
Available on crate feature random only.
impl FromRandom for CRFileSummary
random only.fn from_random() -> Self
Source§impl PartialEq for CRFileSummary
impl PartialEq for CRFileSummary
Source§impl Serialization for CRFileSummary
impl Serialization for CRFileSummary
Source§fn from_bytestream(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, SerializationError>
fn from_bytestream( stream: &Vec<u8>, pos: &mut usize, ) -> Result<Self, SerializationError>
Decode a CRFileSummary from a bytestream
Layout (little endian): HEAD (2) | version (1) | run_id (4) | subrun (8) | n_frames (4) | min_evid (4) | max_evid (4) | first_gcutime (8) | last_gcutime (8) | first_gpstime (8) | last_gpstime (8) | n_sources (1) | sources (n_sources) | n_gaps (4) | gaps (n_gaps x (first u32, count u32)) | magic (4) | footer_len (8) | TAIL (2)
Source§const SIZE: usize = 0
const SIZE: usize = 0
Source§fn guess_size(
stream: &Vec<u8>,
pos: usize,
offset: usize,
) -> Result<(usize, usize, usize), SerializationError>
fn guess_size( stream: &Vec<u8>, pos: usize, offset: usize, ) -> Result<(usize, usize, usize), SerializationError>
Source§fn verify_fixed(
stream: &Vec<u8>,
pos: &mut usize,
) -> Result<(), SerializationError>
fn verify_fixed( stream: &Vec<u8>, pos: &mut usize, ) -> Result<(), SerializationError>
Source§fn from_bytestream_alt(
bytestream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, SerializationError>where
Self: Sized,
fn from_bytestream_alt(
bytestream: &Vec<u8>,
pos: &mut usize,
) -> Result<Self, SerializationError>where
Self: Sized,
impl StructuralPartialEq for CRFileSummary
Auto Trait Implementations§
impl Freeze for CRFileSummary
impl RefUnwindSafe for CRFileSummary
impl Send for CRFileSummary
impl Sync for CRFileSummary
impl Unpin for CRFileSummary
impl UnsafeUnpin for CRFileSummary
impl UnwindSafe for CRFileSummary
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
impl<T> SendAlias for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.