pub struct FileCardStore { /* private fields */ }Expand description
File-backed implementation of CardStore.
Implementations§
Source§impl FileCardStore
impl FileCardStore
pub fn create(&self, input: Json) -> Result<(String, PathBuf), String>
pub fn get(&self, card_id: &str) -> Result<Option<Json>, String>
pub fn list(&self, pkg_filter: Option<&str>) -> Result<Vec<Summary>, String>
pub fn append(&self, card_id: &str, fields: Json) -> Result<Json, String>
pub fn alias_set( &self, name: &str, card_id: &str, pkg: Option<&str>, note: Option<&str>, ) -> Result<Alias, String>
pub fn alias_list(&self, pkg_filter: Option<&str>) -> Result<Vec<Alias>, String>
pub fn get_by_alias(&self, name: &str) -> Result<Option<Json>, String>
pub fn find(&self, q: FindQuery) -> Result<Vec<Summary>, String>
pub fn write_samples( &self, card_id: &str, samples: Vec<Json>, ) -> Result<PathBuf, String>
pub fn read_samples( &self, card_id: &str, q: SamplesQuery, ) -> Result<Vec<Json>, String>
pub fn lineage(&self, q: LineageQuery) -> Result<Option<LineageResult>, String>
pub fn card_sink_backfill( &self, sink: &str, dry_run: bool, ) -> Result<SinkBackfillReport, String>
Trait Implementations§
Source§impl CardStore for FileCardStore
impl CardStore for FileCardStore
Source§fn write_new_card(
&self,
pkg: &str,
card_id: &str,
toml_text: &str,
) -> Result<PathBuf, String>
fn write_new_card( &self, pkg: &str, card_id: &str, toml_text: &str, ) -> Result<PathBuf, String>
Write a new Card (Tier 1 TOML). Read more
Source§fn overwrite_card(
&self,
card_id: &str,
toml_text: &str,
) -> Result<PathBuf, String>
fn overwrite_card( &self, card_id: &str, toml_text: &str, ) -> Result<PathBuf, String>
Overwrite an existing Card (append flow). Read more
Source§fn find_card_locator(&self, card_id: &str) -> Result<Option<PathBuf>, String>
fn find_card_locator(&self, card_id: &str) -> Result<Option<PathBuf>, String>
Locate a Card file by id. Returns
None if not found.Source§fn read_card_text(&self, card_id: &str) -> Result<Option<String>, String>
fn read_card_text(&self, card_id: &str) -> Result<Option<String>, String>
Read a Card’s raw TOML text by id. Returns
None if missing.Source§fn list_card_locators(
&self,
pkg_filter: Option<&str>,
) -> Result<Vec<(String, PathBuf)>, String>
fn list_card_locators( &self, pkg_filter: Option<&str>, ) -> Result<Vec<(String, PathBuf)>, String>
List
(pkg, locator) pairs for every Card file in the store. Read moreSource§fn read_locator_text(&self, locator: &Path) -> Result<Option<String>, String>
fn read_locator_text(&self, locator: &Path) -> Result<Option<String>, String>
Read raw TOML text from a locator returned by
Self::list_card_locators. Ok(None) on read failure so
scans can skip corrupt files without aborting.fn read_aliases(&self) -> Result<Vec<Alias>, String>
fn write_aliases(&self, aliases: &[Alias]) -> Result<(), String>
Source§fn samples_exists(&self, card_id: &str) -> Result<bool, String>
fn samples_exists(&self, card_id: &str) -> Result<bool, String>
Check whether a samples sidecar exists for
card_id.Source§fn write_samples_text(
&self,
card_id: &str,
jsonl_text: &str,
) -> Result<PathBuf, String>
fn write_samples_text( &self, card_id: &str, jsonl_text: &str, ) -> Result<PathBuf, String>
Write a samples sidecar (write-once). Read more
Auto Trait Implementations§
impl Freeze for FileCardStore
impl RefUnwindSafe for FileCardStore
impl Send for FileCardStore
impl Sync for FileCardStore
impl Unpin for FileCardStore
impl UnsafeUnpin for FileCardStore
impl UnwindSafe for FileCardStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.