pub struct Service { /* private fields */ }Implementations§
Source§impl Service
impl Service
Sourcepub fn with_live_cap(self, cap: usize) -> Self
pub fn with_live_cap(self, cap: usize) -> Self
The same service with another live cap; zero is none.
Sourcepub fn live_cap(&self) -> usize
pub fn live_cap(&self) -> usize
Most live claims a workspace holds before the least retrievable are forgotten; zero is no cap.
Sourcepub fn update(
&self,
workspace: &str,
id: &str,
fields: &Map<String, Value>,
) -> Result<Record>
pub fn update( &self, workspace: &str, id: &str, fields: &Map<String, Value>, ) -> Result<Record>
Sourcepub fn delete_atom(
&self,
workspace: &str,
id: &str,
why: Option<&str>,
) -> Result<Record>
pub fn delete_atom( &self, workspace: &str, id: &str, why: Option<&str>, ) -> Result<Record>
Tombstone one atom and drop it from the projection.
why names the deed that withdrew the claim. A retraction cites a deed
or nothing, so unlike an entity it is refused when it is free text: the
point of writing it is that deedar evidence can be asked about it, and
a name no deed store answers for is a citation that only looks like one.
§Errors
AtomError when why is not a deed accession, else the store’s.
Sourcepub fn pin(&self, workspace: &str) -> String
pub fn pin(&self, workspace: &str) -> String
The active set for a workspace, or empty when nothing is pinned.
Sourcepub fn pin_payload(&self, workspace: &str) -> Result<Value>
pub fn pin_payload(&self, workspace: &str) -> Result<Value>
The pin plus that set’s standing instructions.
§Errors
Never, in practice: an unreadable set reads as empty.
Sourcepub fn write_set(
&self,
workspace: &str,
name: &str,
body: &Map<String, Value>,
) -> Result<String, WriteError>
pub fn write_set( &self, workspace: &str, name: &str, body: &Map<String, Value>, ) -> Result<String, WriteError>
Sourcepub fn set_user(&self, text: &str) -> Result<(), WriteError>
pub fn set_user(&self, text: &str) -> Result<(), WriteError>
Write the seat card, archiving and refusing on overflow.
§Errors
The write’s, with overflow distinguishable so the caller can answer 413.
Sourcepub fn set_memory(&self, workspace: &str, text: &str) -> Result<(), WriteError>
pub fn set_memory(&self, workspace: &str, text: &str) -> Result<(), WriteError>
Sourcepub fn put_attach(&self, workspace: &str, text: &str, label: &str) -> Value
pub fn put_attach(&self, workspace: &str, text: &str, label: &str) -> Value
Hold one body for a workspace, capped.
Sourcepub fn take_attach(&self, workspace: &str) -> Option<Attachment>
pub fn take_attach(&self, workspace: &str) -> Option<Attachment>
Take the held body, leaving the slot empty: an attachment is one turn’s.
Sourcepub fn peek_attach(&self, workspace: &str) -> Option<Attachment>
pub fn peek_attach(&self, workspace: &str) -> Option<Attachment>
Read the held body without taking it.
Sourcepub fn as_of(&self, workspace: &str, at: &str) -> Result<Value>
pub fn as_of(&self, workspace: &str, at: &str) -> Result<Value>
The atoms that were live at at, over the valid_from / valid_to window.
§Errors
The store’s, or a stamp parse_millis will not accept.
Sourcepub fn search(
&self,
workspace: &str,
query: &str,
limit: usize,
set: Option<&str>,
panel: &Panel,
as_of: Option<&str>,
rerank: bool,
) -> Result<Value>
pub fn search( &self, workspace: &str, query: &str, limit: usize, set: Option<&str>, panel: &Panel, as_of: Option<&str>, rerank: bool, ) -> Result<Value>
Ranked hits, and which engine produced them: the projection when
present, else the linear scan; any projection failure falls back whole.
as_of retrieves the atoms live then; rerank runs the cross-encoder
second stage.
§Errors
AtomError for a bad set name, a stamp parse_millis will not
accept, else the store’s.
Sourcepub fn compact(
&self,
workspace: &str,
day: Option<&str>,
transcript: Option<&str>,
) -> Result<Value>
pub fn compact( &self, workspace: &str, day: Option<&str>, transcript: Option<&str>, ) -> Result<Value>
Sourcepub fn islands(&self, workspace: &str) -> Result<Value>
pub fn islands(&self, workspace: &str) -> Result<Value>
The islands of a workspace: the link graph’s communities, largest first, each as the atoms it holds.
§Errors
The store’s.
Sourcepub fn hubs(&self, workspace: &str, limit: usize) -> Result<Value>
pub fn hubs(&self, workspace: &str, limit: usize) -> Result<Value>
The claims the link graph turns on, highest first: a weighted PageRank over the links. What matters in the pack by its own connections, before any query.
§Errors
The store’s.
Sourcepub fn fire(&self, workspace: &str, ids: &[String]) -> Result<Value>
pub fn fire(&self, workspace: &str, ids: &[String]) -> Result<Value>
Claims that fired together: every pair’s link gains weight, their other links lose a little, and a missing link is made. Returns how many records changed.
§Errors
The store’s.
Sourcepub fn consolidate(&self, workspace: &str, apply: bool) -> Result<Value>
pub fn consolidate(&self, workspace: &str, apply: bool) -> Result<Value>
Consolidate the live set: in the order they were written, every
claim that replaces an earlier one (record::replaces: an explicit
supersedes, a correction sharing an entity, a rewrite, or a new
object under the same head) closes the earlier one’s window and
names it. What a write does on arrival, run over what is already
held, for a pack written before the rule or filled by import. With
apply false nothing is written; the pairs are reported.
§Errors
The store’s.
Sourcepub fn activate(
&self,
workspace: &str,
query: &str,
limit: usize,
panel: &Panel,
fire: bool,
) -> Result<Value>
pub fn activate( &self, workspace: &str, query: &str, limit: usize, panel: &Panel, fire: bool, ) -> Result<Value>
The memories a cue activates: the top search hits as seeds, spread
two hops along the links, strongest first. With fire, the top
[FIRE_TOP] of them fire together.
§Errors
As Service::search, else the store’s.
Sourcepub fn accessions(&self, workspace: &str) -> Result<Vec<String>>
pub fn accessions(&self, workspace: &str) -> Result<Vec<String>>
Every deed accession cited by a live atom in a workspace, sorted.
The accession is the only identifier that crosses the tracker, the pack and the deed store, so a pack has to be able to list its own citations the way a tracker does. A product cited by one atom and by nothing else is exactly the citation that goes stale unnoticed.
§Errors
The store’s.
Sourcepub fn citers(&self, workspace: &str, accession: &str) -> Result<Vec<Value>>
pub fn citers(&self, workspace: &str, accession: &str) -> Result<Vec<Value>>
The live atoms that cite one deed accession.
The other direction of Service::accessions, and the pack’s half of
the backwards walk: a tracker answers which issues cite a product, and
this answers which remembered claims do. Neither store opens the other,
so what composes them is a caller holding one accession.
§Errors
The store’s.