pub struct LookupRepository { /* private fields */ }Expand description
A repository for managing lookup tables on disk.
Implementations§
Source§impl LookupRepository
impl LookupRepository
pub fn new<P: AsRef<Path>>(base_path: P) -> Self
pub fn save(&self, id: &ModelIdentifier, table: &LookupTable) -> Result<()>
pub fn load(&self, id: &ModelIdentifier) -> Result<LookupTable>
pub fn exists(&self, id: &ModelIdentifier) -> bool
Sourcepub fn list_files(&self) -> Vec<PathBuf>
pub fn list_files(&self) -> Vec<PathBuf>
List all available model identifiers in the repository. This is a bit tricky because we’d need to parse filenames back to IDs, or store a separate index. For now, we just list files.
Auto Trait Implementations§
impl Freeze for LookupRepository
impl RefUnwindSafe for LookupRepository
impl Send for LookupRepository
impl Sync for LookupRepository
impl Unpin for LookupRepository
impl UnsafeUnpin for LookupRepository
impl UnwindSafe for LookupRepository
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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