pub struct DataSet<T: DataSetT, const ENTRIES: usize> {
pub metadata: Metadata,
pub lut: LookUpTable<ENTRIES>,
pub data_checksum: u32,
pub bytes: Bytes,
/* private fields */
}
Expand description
A DataSet is the core structure shared by all ANISE binary data.
Fields§
§metadata: Metadata
§lut: LookUpTable<ENTRIES>
All datasets have LookUpTable (LUT) that stores the mapping between a key and its index in the ephemeris list.
data_checksum: u32
§bytes: Bytes
The actual data from the dataset
Implementations§
source§impl DataSet<PlanetaryData, MAX_PLANETARY_DATA>
impl DataSet<PlanetaryData, MAX_PLANETARY_DATA>
source§impl<T: DataSetT, const ENTRIES: usize> DataSet<T, ENTRIES>
impl<T: DataSetT, const ENTRIES: usize> DataSet<T, ENTRIES>
sourcepub fn try_from_bytes<B: Deref<Target = [u8]>>(
bytes: B
) -> Result<Self, DataSetError>
pub fn try_from_bytes<B: Deref<Target = [u8]>>( bytes: B ) -> Result<Self, DataSetError>
Try to load an Anise file from a pointer of bytes
sourcepub fn from_bytes<B: Deref<Target = [u8]>>(buf: B) -> Self
pub fn from_bytes<B: Deref<Target = [u8]>>(buf: B) -> Self
Forces to load an Anise file from a pointer of bytes. Panics if the bytes cannot be interpreted as an Anise file.
pub fn check_integrity(&self) -> Result<(), IntegrityError>
sourcepub fn scrub(&self) -> Result<(), IntegrityError>
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 get_by_id(&self, id: i32) -> Result<T, DataSetError>
pub fn get_by_name(&self, name: &str) -> Result<T, DataSetError>
Trait Implementations§
source§impl<T: DataSetT, const ENTRIES: usize> Encode for DataSet<T, ENTRIES>
impl<T: DataSetT, const ENTRIES: usize> Encode for DataSet<T, ENTRIES>
source§fn encoded_len(&self) -> Result<Length>
fn encoded_len(&self) -> Result<Length>
Compute the length of this value in bytes when encoded as ASN.1 DER.
source§fn encode(&self, encoder: &mut impl Writer) -> Result<()>
fn encode(&self, encoder: &mut impl Writer) -> Result<()>
Encode this value as ASN.1 DER using the provided
Writer
.source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.
source§impl<T: PartialEq + DataSetT, const ENTRIES: usize> PartialEq for DataSet<T, ENTRIES>
impl<T: PartialEq + DataSetT, const ENTRIES: usize> PartialEq for DataSet<T, ENTRIES>
impl<T: Eq + DataSetT, const ENTRIES: usize> Eq for DataSet<T, ENTRIES>
impl<T: DataSetT, const ENTRIES: usize> StructuralPartialEq for DataSet<T, ENTRIES>
Auto Trait Implementations§
impl<T, const ENTRIES: usize> !Freeze for DataSet<T, ENTRIES>
impl<T, const ENTRIES: usize> RefUnwindSafe for DataSet<T, ENTRIES>
impl<T, const ENTRIES: usize> Send for DataSet<T, ENTRIES>
impl<T, const ENTRIES: usize> Sync for DataSet<T, ENTRIES>
impl<T, const ENTRIES: usize> Unpin for DataSet<T, ENTRIES>
impl<T, const ENTRIES: usize> UnwindSafe for DataSet<T, ENTRIES>
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.