pub struct ImportService<'a> { /* private fields */ }Expand description
Service for CSV import
Implementations§
Source§impl<'a> ImportService<'a>
impl<'a> ImportService<'a>
Sourcepub fn parse_csv_from_reader<R: Read>(
&self,
reader: &mut Reader<R>,
mapping: &ColumnMapping,
) -> EnvelopeResult<Vec<Result<ParsedTransaction, String>>>
pub fn parse_csv_from_reader<R: Read>( &self, reader: &mut Reader<R>, mapping: &ColumnMapping, ) -> EnvelopeResult<Vec<Result<ParsedTransaction, String>>>
Parse a CSV from a reader into transactions
Sourcepub fn detect_mapping_from_headers(
&self,
headers: &StringRecord,
) -> ColumnMapping
pub fn detect_mapping_from_headers( &self, headers: &StringRecord, ) -> ColumnMapping
Detect column mapping from CSV header record
Sourcepub fn generate_preview(
&self,
parsed: &[Result<ParsedTransaction, String>],
account_id: AccountId,
) -> EnvelopeResult<Vec<ImportPreviewEntry>>
pub fn generate_preview( &self, parsed: &[Result<ParsedTransaction, String>], account_id: AccountId, ) -> EnvelopeResult<Vec<ImportPreviewEntry>>
Generate an import preview, checking for duplicates
Sourcepub fn import_from_preview(
&self,
preview: &[ImportPreviewEntry],
account_id: AccountId,
default_category_id: Option<CategoryId>,
mark_cleared: bool,
) -> EnvelopeResult<ImportResult>
pub fn import_from_preview( &self, preview: &[ImportPreviewEntry], account_id: AccountId, default_category_id: Option<CategoryId>, mark_cleared: bool, ) -> EnvelopeResult<ImportResult>
Import transactions from a preview
Auto Trait Implementations§
impl<'a> Freeze for ImportService<'a>
impl<'a> RefUnwindSafe for ImportService<'a>
impl<'a> Send for ImportService<'a>
impl<'a> Sync for ImportService<'a>
impl<'a> Unpin for ImportService<'a>
impl<'a> UnwindSafe for ImportService<'a>
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> 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