Type Alias BPC

pub type BPC = GenericDAF<BPCSummaryRecord, Bytes>;
Expand description

Binary Planetary Constant

Aliased Type§

struct BPC {
    pub bytes: Bytes,
    pub crc32_checksum: u32,
    pub _daf_type: PhantomData<BPCSummaryRecord>,
}

Fields§

§bytes: Bytes§crc32_checksum: u32§_daf_type: PhantomData<BPCSummaryRecord>

Implementations

§

impl<R> GenericDAF<R, Bytes>

pub fn parse<B>(bytes: B) -> Result<GenericDAF<R, Bytes>, DAFError>
where B: Deref<Target = [u8]>,

Parse the provided bytes as a SPICE Double Array File

pub fn check_then_parse<B>( bytes: B, expected: u32, ) -> Result<GenericDAF<R, Bytes>, DAFError>
where B: Deref<Target = [u8]>,

Parse the DAF only if the CRC32 checksum of the data is valid

pub fn load(path: &str) -> Result<GenericDAF<R, Bytes>, DAFError>

pub fn from_static<B>( bytes: &'static B, ) -> Result<GenericDAF<R, Bytes>, DAFError>
where B: Deref<Target = [u8]>,

Parse the provided static byte array as a SPICE Double Array File

pub fn to_mutable(&self) -> GenericDAF<R, BytesMut>

Copies the underlying bytes of this DAF into a MutDAF, enabling modification of the DAF.

§

impl<R, W> GenericDAF<R, W>
where R: NAIFSummaryRecord, W: MutKind,

pub fn crc32(&self) -> u32

Compute the CRC32 of the underlying bytes

pub fn scrub(&self) -> Result<(), IntegrityError>

Scrubs the data by computing the CRC32 of the bytes and making sure that it still matches the previously known hash

pub fn file_record(&self) -> Result<FileRecord, DAFError>

pub fn name_record(&self) -> Result<NameRecord, DAFError>

pub fn daf_summary(&self) -> Result<SummaryRecord, DAFError>

pub fn data_summaries(&self) -> Result<&[R], DAFError>

Parses the data summaries on the fly.

pub fn summary_from_name(&self, name: &str) -> Result<(&R, usize), DAFError>

Returns the summary given the name of the summary record

pub fn summary_from_name_at_epoch( &self, name: &str, epoch: Epoch, ) -> Result<(&R, usize), DAFError>

Returns the summary given the name of the summary record if that summary has data defined at the requested epoch

pub fn summary_from_id(&self, id: i32) -> Result<(&R, usize), DAFError>

Returns the summary given the id of the summary record

pub fn summary_from_id_at_epoch( &self, id: i32, epoch: Epoch, ) -> Result<(&R, usize), DAFError>

Returns the summary given the name of the summary record if that summary has data defined at the requested epoch

pub fn data_from_name<'a, S>(&'a self, name: &str) -> Result<S, DAFError>
where S: NAIFDataSet<'a>,

Provided a name that is in the summary, return its full data, if name is available.

pub fn nth_data<'a, S>(&'a self, idx: usize) -> Result<S, DAFError>
where S: NAIFDataSet<'a>,

Provided a name that is in the summary, return its full data, if name is available.

pub fn comments(&self) -> Result<Option<String>, DAFError>

pub fn persist<P>(&self, path: P) -> Result<(), Error>
where P: AsRef<Path>,

Writes the contents of this DAF file to a new location.

Trait Implementations

§

impl<R, W> Clone for GenericDAF<R, W>
where R: Clone + NAIFSummaryRecord, W: Clone + MutKind,

§

fn clone(&self) -> GenericDAF<R, W>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<R, W> Debug for GenericDAF<R, W>
where R: Debug + NAIFSummaryRecord, W: Debug + MutKind,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<R, W> Default for GenericDAF<R, W>
where R: Default + NAIFSummaryRecord, W: Default + MutKind,

§

fn default() -> GenericDAF<R, W>

Returns the “default value” for a type. Read more
§

impl<R, W> Hash for GenericDAF<R, W>
where R: NAIFSummaryRecord, W: MutKind,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Hash will only hash the bytes, nothing else (since these are derived from the bytes anyway).

1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl NAIFPrettyPrint for GenericDAF<BPCSummaryRecord, Bytes>

§

fn describe_in(&self, time_scale: TimeScale, round: Option<bool>) -> String

Returns a string of a table representing this BPC where the epochs are printed in the provided time scale Set round to Some(false) to not round the durations. By default, the durations will be rounded to the nearest second.

§

fn describe(&self) -> String

§

impl<R, W> PartialEq for GenericDAF<R, W>
where R: PartialEq + NAIFSummaryRecord, W: PartialEq + MutKind,

§

fn eq(&self, other: &GenericDAF<R, W>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<R, W> StructuralPartialEq for GenericDAF<R, W>
where R: NAIFSummaryRecord, W: MutKind,