Struct MicroDataCollection

Source
pub struct MicroDataCollection {
    pub name: String,
    pub record_hierarchy: RecordHierarchy,
    pub record_types: HashMap<String, RecordType>,
    pub default_unit_of_analysis: RecordType,
    pub metadata: Option<MetadataEntities>,
}
Expand description

Key characteristics of data collections

Fields§

§name: String§record_hierarchy: RecordHierarchy§record_types: HashMap<String, RecordType>§default_unit_of_analysis: RecordType§metadata: Option<MetadataEntities>

Implementations§

Source§

impl MicroDataCollection

Source

pub fn weight_for_rectype(&self, rt: &str) -> Option<String>

Source

pub fn sample_line_weight_for_rectype(&self, rt: &str) -> Option<String>

Source

pub fn weight_divisor(&self, rt: &str) -> Option<usize>

Source

pub fn sample_line_weight_divisor(&self, rt: &str) -> Option<usize>

Source

pub fn base_filename_for_dataset(&self, dataset_name: &str) -> String

Source

pub fn base_filename_for_dataset_and_rectype( &self, dataset_name: &str, record_type_abbrev: &str, ) -> String

Source

pub fn default_table_name( &self, dataset_name: &str, record_type_abbrev: &str, ) -> Result<String, MdError>

Source

pub fn load_metadata_from_layout(&mut self, _layout_file: &Path)

Read one fixed-width layout file. These files contain some variable level metadata for every record type in the data product.

Source

pub fn load_metadata_from_all_layouts(&mut self, _layouts_dir: &Path)

Read all layout files for the data root like ../output_data/current/layouts The existence of a layout file implies existence of a dataset. The presence of a variable in a dataset’s layout indicates availability in that dataset.

Source

pub fn load_metadata_from_parquet(&mut self, _parquet_dataset_path: &Path)

The path like ../output_data/current/parquet/us2019a/ Reading the schema will give approximately the same metadata information as reading the fixed-width layout file for the same dataset.

Source

pub fn load_metadata_for_selected_datasets_from_layouts( &mut self, datasets: &[&str], data_root: &Path, ) -> Result<(), MdError>

Using the data_root, scan the layouts and load metadata from them.

Source

pub fn load_full_metadata_for_datasets(&mut self, _datasets: &[String])

Uses default product_root to find metadata database and load all metadata for given datasets.

Source

pub fn load_metadata_from_all_parquet(&mut self, _parquet_path: &Path)

Takes a path like ../output_data/current/parquet/, which could be derived automatically from defaults based on data root or product root. Scans all parquet schema information.

Source

pub fn load_full_metadata_for_selections( &mut self, _variables: &[String], _datasets: &[String], _metadata_location: Option<PathBuf>, )

Load everything available for the selected variables and samples from the available metadata database file. Requires ‘allow_full_metadata’ which depends on a product root and a ‘metadata.db’ file located in the root/metadata/versions location, unless you provide a Some(metadata_location).

Source

pub fn load_full_metadata(&mut self, _metadata_location: Option<PathBuf>)

Load all variables and samples for the context and the default metadata location unless you provide Some(metadata_location) to override the default. The result of the load may be very large, into the gigabyte range.

Source

pub fn clear_metadata(&mut self)

Trait Implementations§

Source§

impl Clone for MicroDataCollection

Source§

fn clone(&self) -> MicroDataCollection

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
Source§

impl Debug for MicroDataCollection

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,