pub struct ColumnMapping {
pub date_column: usize,
pub amount_column: Option<usize>,
pub outflow_column: Option<usize>,
pub inflow_column: Option<usize>,
pub payee_column: Option<usize>,
pub memo_column: Option<usize>,
pub date_format: String,
pub has_header: bool,
pub delimiter: char,
pub invert_amounts: bool,
}Expand description
Column mapping configuration for CSV import
Fields§
§date_column: usizeIndex of the date column
amount_column: Option<usize>Index of the amount column (or separate inflow/outflow columns)
outflow_column: Option<usize>Index of the outflow column (if using separate columns)
inflow_column: Option<usize>Index of the inflow column (if using separate columns)
payee_column: Option<usize>Index of the payee/description column
memo_column: Option<usize>Index of the memo/notes column
date_format: StringDate format string (e.g., “%Y-%m-%d”, “%m/%d/%Y”)
has_header: boolWhether the first row is a header
delimiter: charDelimiter character
invert_amounts: boolWhether to invert amounts (some banks use positive for debits)
Implementations§
Source§impl ColumnMapping
impl ColumnMapping
Sourcepub fn simple_bank() -> Self
pub fn simple_bank() -> Self
Common mapping for bank CSV exports (date, description, amount)
Sourcepub fn credit_card() -> Self
pub fn credit_card() -> Self
Common mapping for credit card CSV exports
Sourcepub fn separate_inout(
date_col: usize,
outflow_col: usize,
inflow_col: usize,
payee_col: usize,
) -> Self
pub fn separate_inout( date_col: usize, outflow_col: usize, inflow_col: usize, payee_col: usize, ) -> Self
Mapping for separate inflow/outflow columns
Sourcepub fn with_date_format(self, format: &str) -> Self
pub fn with_date_format(self, format: &str) -> Self
Set the date format
Sourcepub fn with_header(self, has_header: bool) -> Self
pub fn with_header(self, has_header: bool) -> Self
Set whether first row is header
Sourcepub fn with_delimiter(self, delimiter: char) -> Self
pub fn with_delimiter(self, delimiter: char) -> Self
Set the delimiter
Trait Implementations§
Source§impl Clone for ColumnMapping
impl Clone for ColumnMapping
Source§fn clone(&self) -> ColumnMapping
fn clone(&self) -> ColumnMapping
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColumnMapping
impl Debug for ColumnMapping
Auto Trait Implementations§
impl Freeze for ColumnMapping
impl RefUnwindSafe for ColumnMapping
impl Send for ColumnMapping
impl Sync for ColumnMapping
impl Unpin for ColumnMapping
impl UnwindSafe for ColumnMapping
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more