pub struct CsvPartialCache<T> {
pub path: PathBuf,
pub items: Box<[T]>,
}
Expand description
An index that stores data as a boxed slice sorted by ID.
Fields§
§path: PathBuf
The path to the CSV file.
items: Box<[T]>
The items in the cache.
Implementations§
Source§impl<T> CsvPartialCache<T>where
T: FromLineOffset,
impl<T> CsvPartialCache<T>where
T: FromLineOffset,
Sourcepub fn new(path: impl Into<PathBuf>) -> Result<Self>
pub fn new(path: impl Into<PathBuf>) -> Result<Self>
Creates a new CsvPartialCache
from a path.
Sourcepub async fn full_record<D: DeserializeOwned>(&self, row: &T) -> Result<D>
pub async fn full_record<D: DeserializeOwned>(&self, row: &T) -> Result<D>
Returns the full record by its ID, deserialized into D
.
Source§impl<T> CsvPartialCache<T>
impl<T> CsvPartialCache<T>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for CsvPartialCache<T>
impl<T> RefUnwindSafe for CsvPartialCache<T>where
T: RefUnwindSafe,
impl<T> Send for CsvPartialCache<T>where
T: Send,
impl<T> Sync for CsvPartialCache<T>where
T: Sync,
impl<T> Unpin for CsvPartialCache<T>
impl<T> UnwindSafe for CsvPartialCache<T>where
T: UnwindSafe,
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