1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Data/Value Sets are like a `Vec<E>`, but E are stored remotely and only fetched when needed.
//!
//! 1. When we operate with DataSet, we do not know how many rows are in it.
//! An example dataset could contain all the orders placed by a client.
//!
//! 2. Remotely stored data can be modified externally, for instance if multiple application
//! instances are operating in parallel.
//!
//! 3. Data loaded from DataSet may be incomplete - some columns may be inaccessible.
//!
//! 4. All records must have a unique ID, which will always point to the same record.
//!
//! Vantage provides [`DataSet<E>`] and [`ValueSet`] traits for a consistent interface.
//! There are three sub-traits for datasets:
//! - [`ReadableDataSet`]: allows reading rows
//! - [`InsertableDataSet`]: allows inserting new rows
//! - [`WritableDataSet`]: allows updating or deleting rows
//!
//! For ValueSet there are also [`ReadableValueSet`], [`InsertableValueSet`] and [`WritableValueSet`].
//!
//! # Example: Time Travel Records
//!
//! ```rust,ignore
//! use vantage_dataset::prelude::*;
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Serialize, Deserialize, Clone)]
//! struct TimeTraveler {
//! name: String,
//! year_traveled: i32,
//! destination: String,
//! }
//!
//! // Read time travel records from CSV file
//! let csv_data = CsvFile::<TimeTraveler>::new(csv_source, "time_travelers.csv");
//!
//! for (id, traveler) in csv_data.list().await? {
//! println!("{} traveled to {} in {}",
//! traveler.name, traveler.destination, traveler.year_traveled);
//! }
//! // Output: "Marty McFly traveled to 1885 in 2015"
//! ```
//!
//! `csv_data` implements ReadableDataSet and ReadableValueSet, meaning you can also use [`list_values`](ReadableValueSet::list_values)
//! as well as [`list`](ReadableDataSet::list) to get the records.
use async_trait;
pub use ;
use Entity;
pub use *;
pub use *;
/// Trait for datasets that can import records from other datasets