pub struct HypermediaStore { /* private fields */ }Expand description
On-disk library store (whole-file JSON, write-temp-then-rename), matching the sibling-store convention.
Implementations§
Source§impl HypermediaStore
impl HypermediaStore
pub fn open(storage_root: impl AsRef<Path>) -> Result<Self>
pub fn load(&self) -> Result<Vec<LibraryEntry>>
Sourcepub fn add(&self, entry: LibraryEntry) -> Result<()>
pub fn add(&self, entry: LibraryEntry) -> Result<()>
Add (or replace by asset_uri) an entry.
Sourcepub fn replace_all(&self, entries: &[LibraryEntry]) -> Result<()>
pub fn replace_all(&self, entries: &[LibraryEntry]) -> Result<()>
Replace the entire library (used by bulk seed paths — one write).
Sourcepub fn all(&self) -> Result<Vec<LibraryEntry>>
pub fn all(&self) -> Result<Vec<LibraryEntry>>
Everything in the library (newest first).
Sourcepub fn by_section(&self, section: LibrarySection) -> Result<Vec<LibraryEntry>>
pub fn by_section(&self, section: LibrarySection) -> Result<Vec<LibraryEntry>>
Entries in one product section (all = everything).
Sourcepub fn section_counts(&self) -> Result<BTreeMap<String, usize>>
pub fn section_counts(&self) -> Result<BTreeMap<String, usize>>
Counts per section for the section rail UI.
Sourcepub fn set_commons_visibility(
&self,
asset_uri: &str,
visibility: CommonsVisibility,
) -> Result<LibraryEntry>
pub fn set_commons_visibility( &self, asset_uri: &str, visibility: CommonsVisibility, ) -> Result<LibraryEntry>
Publish (or revoke) commons visibility — never allowed for Secret / high sensitivity.
Sourcepub fn search(&self, facet: &str, value: &str) -> Result<Vec<LibraryEntry>>
pub fn search(&self, facet: &str, value: &str) -> Result<Vec<LibraryEntry>>
Run a graph query over the union of all entries’ quins, returning matching entries. facet is one of
topic | depicts | place | project | purpose.
Sourcepub fn search_time_range(
&self,
start: i64,
end: i64,
) -> Result<Vec<LibraryEntry>>
pub fn search_time_range( &self, start: i64, end: i64, ) -> Result<Vec<LibraryEntry>>
The timeline query — entries whose event instant is within [start, end] (unix seconds).
Sourcepub fn search_text(&self, query: &str) -> Result<Vec<LibraryEntry>>
pub fn search_text(&self, query: &str) -> Result<Vec<LibraryEntry>>
Free-text filter over uri, excerpt, topics, projects, purposes, place (case-insensitive).
Sourcepub fn query_faceted(
&self,
filter: &FacetFilter,
sort: LibrarySort,
) -> Result<Vec<LibraryEntry>>
pub fn query_faceted( &self, filter: &FacetFilter, sort: LibrarySort, ) -> Result<Vec<LibraryEntry>>
Multi-facet filter + sort. Facets are AND across dimensions; within each non-empty list, match is OR (any of the selected values).
Categories match topics containing the slug or projects of form category:{slug}.
Sourcepub fn facet_counts(&self, filter: &FacetFilter) -> Result<FacetCounts>
pub fn facet_counts(&self, filter: &FacetFilter) -> Result<FacetCounts>
Facet value counts over entries matching filter (for chip UI). Counts are
computed after the filter so selecting a category narrows other facet tallies.
Sourcepub fn stats(&self) -> Result<LibraryStats>
pub fn stats(&self) -> Result<LibraryStats>
Library stats for the UI chrome.
Auto Trait Implementations§
impl Freeze for HypermediaStore
impl RefUnwindSafe for HypermediaStore
impl Send for HypermediaStore
impl Sync for HypermediaStore
impl Unpin for HypermediaStore
impl UnsafeUnpin for HypermediaStore
impl UnwindSafe for HypermediaStore
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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