pub struct ImportSpec {
pub path: PathBuf,
pub delimiter: u8,
pub has_header: bool,
pub measure_id: MeasureId,
pub measure_name: String,
pub value_type: ValueType,
pub value_column: ColumnRef,
pub dimensions: Vec<DimensionMapping>,
pub item_id_base: u32,
pub max_records: Option<usize>,
}Expand description
How to map a CSV/TSV file’s columns onto model elements. Each dimensions
entry names a column that becomes a category; value_column names the
column that becomes the imported measure’s value. A row therefore
contributes one input cell: measure[dim=val, …] = value_column.
Fields§
§path: PathBufFile to read (ignored by import_csv_from, which takes a reader).
delimiter: u8Field delimiter: b',' for CSV, b'\t' for TSV.
has_header: boolWhether the file’s first row is a header (enables ColumnRef::Name).
measure_id: MeasureIdThe measure to create/populate for the value column.
measure_name: String§value_type: ValueTypeThe declared type of the value column. Number parses strictly
(a non-numeric value errors); Boolean/Text never error on the value
column — a Boolean column that fails to match true/false falls back
to Text for that cell.
value_column: ColumnRef§dimensions: Vec<DimensionMapping>§item_id_base: u32Base id for minting item ids; new items get sequential ids from here.
max_records: Option<usize>Most data records accepted; more is an error. None means
DEFAULT_MAX_RECORDS.
Auto Trait Implementations§
impl Freeze for ImportSpec
impl RefUnwindSafe for ImportSpec
impl Send for ImportSpec
impl Sync for ImportSpec
impl Unpin for ImportSpec
impl UnsafeUnpin for ImportSpec
impl UnwindSafe for ImportSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§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>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign, for types that do not implement AddAssign.