pub struct PacksetClient { /* private fields */ }Implementations§
Source§impl PacksetClient
impl PacksetClient
pub fn new(base: impl Into<String>) -> Self
Sourcepub fn with_workspace(self, workspace: impl Into<String>) -> Self
pub fn with_workspace(self, workspace: impl Into<String>) -> Self
Pin the workspace this client speaks for, ahead of PACKSET_WORKSPACE
and the working directory. A seat that is one memory across every
repository it works in sets this once.
Sourcepub fn from_env() -> Result<Self, Error>
pub fn from_env() -> Result<Self, Error>
The writer the seat talks to, with nothing set: PACKSET_URL
(INSIDE_MEMORY_URL is an alias), else the loopback port the command
line starts a writer on, PACKSET_PORT (GROK_MEM_PORT) or 8761.
PACKSET_URL=off is the one way to have no pack.
pub fn base(&self) -> &str
pub fn workspace(&self) -> String
Sourcepub fn workspace_for_cwd(&self, cwd: &Path) -> String
pub fn workspace_for_cwd(&self, cwd: &Path) -> String
Workspace id from /v1/identity for cwd, or dir:<abs> if that call fails.
pub fn health(&self) -> Result<String, Error>
pub fn get_atom(&self, workspace: &str, id: &str) -> Result<Value, Error>
pub fn list_atoms(&self, workspace: &str) -> Result<Vec<Value>, Error>
Sourcepub fn atoms_as_of(
&self,
workspace: &str,
as_of: Option<&str>,
) -> Result<Vec<Value>, Error>
pub fn atoms_as_of( &self, workspace: &str, as_of: Option<&str>, ) -> Result<Vec<Value>, Error>
Live-now atoms, or the ones that were live at as_of.
§Errors
The request’s, or a body that is not JSON.
pub fn search( &self, workspace: &str, q: &str, limit: u32, ) -> Result<Vec<Hit>, Error>
Sourcepub fn search_as_of(
&self,
workspace: &str,
q: &str,
limit: u32,
as_of: Option<&str>,
) -> Result<Vec<Hit>, Error>
pub fn search_as_of( &self, workspace: &str, q: &str, limit: u32, as_of: Option<&str>, ) -> Result<Vec<Hit>, Error>
Ranked hits, optionally over the atoms that were live at as_of.
§Errors
The request’s, or a body that is not JSON.
Sourcepub fn search_opts(
&self,
workspace: &str,
q: &str,
limit: u32,
as_of: Option<&str>,
rerank: bool,
) -> Result<Vec<Hit>, Error>
pub fn search_opts( &self, workspace: &str, q: &str, limit: u32, as_of: Option<&str>, rerank: bool, ) -> Result<Vec<Hit>, Error>
Ranked hits, optionally dated and optionally through the measured cross-encoder stage.
Off by default. On, the writer spends a forward pass per candidate and the request waits for that rather than the usual five-second budget.
§Errors
The request’s, or a body that is not a hit list.
Sourcepub fn status(&self, workspace: Option<&str>) -> Result<Value, Error>
pub fn status(&self, workspace: Option<&str>) -> Result<Value, Error>
Seat home, atom counts by kind, pin, index and embedder.
§Errors
The request’s, or a body that is not JSON.
Sourcepub fn accessions(&self, workspace: &str) -> Result<Vec<String>, Error>
pub fn accessions(&self, workspace: &str) -> Result<Vec<String>, Error>
The deed accessions a workspace’s live atoms cite, sorted.
The accession is the only identifier crossing the tracker, the pack and
the deed store, so this is what deedar evidence - reads.
§Errors
The request’s, or a body that is not JSON.
Sourcepub fn atoms(&self, workspace: &str) -> Result<Vec<Value>, Error>
pub fn atoms(&self, workspace: &str) -> Result<Vec<Value>, Error>
Every live atom in a workspace.
The bodies, not the join keys: this is what a handover carries when somebody is given what the seat learned rather than only what it cites.
§Errors
The request’s, or a body that is not JSON.
Sourcepub fn citers(
&self,
workspace: &str,
accession: &str,
) -> Result<Vec<Value>, Error>
pub fn citers( &self, workspace: &str, accession: &str, ) -> Result<Vec<Value>, Error>
The live atoms in a workspace that cite one deed accession.
§Errors
The request’s, or a body that is not JSON.
Sourcepub fn delete_atom(
&self,
workspace: &str,
id: &str,
why: Option<&str>,
) -> Result<Value, Error>
pub fn delete_atom( &self, workspace: &str, id: &str, why: Option<&str>, ) -> Result<Value, Error>
Tombstone one atom. The daemon keeps the record and drops the index entry, so a forgotten atom stops being recalled without the pack losing the fact that it once held it.
why is the deed accession that withdrew the claim, and the daemon
refuses one that is not an accession. It rides onto the tombstone beside
the text, so the retraction and what it retracted read back together.
§Errors
Error::Bad when the workspace does not hold that atom, else the
request’s or a body that is not JSON.
Sourcepub fn grade(
&self,
workspace: &str,
id: &str,
recalled: bool,
) -> Result<Value, Error>
pub fn grade( &self, workspace: &str, id: &str, recalled: bool, ) -> Result<Value, Error>
Move one atom along the review clock: recalled, or lapsed.
Sourcepub fn hubs(&self, workspace: &str, limit: usize) -> Result<Value, Error>
pub fn hubs(&self, workspace: &str, limit: usize) -> Result<Value, Error>
The link graph’s communities, largest first. The claims the link graph turns on, highest first.
pub fn islands(&self, workspace: &str) -> Result<Value, Error>
Sourcepub fn fire(&self, workspace: &str, ids: &[String]) -> Result<Value, Error>
pub fn fire(&self, workspace: &str, ids: &[String]) -> Result<Value, Error>
Claims that fired together: their links gain weight.
Sourcepub fn consolidate(&self, workspace: &str, apply: bool) -> Result<Value, Error>
pub fn consolidate(&self, workspace: &str, apply: bool) -> Result<Value, Error>
Consolidate the workspace: every claim that replaces an earlier one
closes it (the write-time rule, run over what is held). apply
false reports the pairs and writes nothing.
Sourcepub fn activate(
&self,
workspace: &str,
q: &str,
limit: u32,
fire: bool,
) -> Result<Value, Error>
pub fn activate( &self, workspace: &str, q: &str, limit: u32, fire: bool, ) -> Result<Value, Error>
The memories a cue activates, strongest first; with fire, the top
of them fire together.
pub fn post_atom(&self, atom: &Value) -> Result<Value, Error>
Trait Implementations§
Source§impl Clone for PacksetClient
impl Clone for PacksetClient
Source§fn clone(&self) -> PacksetClient
fn clone(&self) -> PacksetClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more