Skip to main content

PacksetClient

Struct PacksetClient 

Source
pub struct PacksetClient { /* private fields */ }

Implementations§

Source§

impl PacksetClient

Source

pub fn new(base: impl Into<String>) -> Self

Source

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.

Source

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.

Source

pub fn base(&self) -> &str

Source

pub fn workspace(&self) -> String

Source

pub fn workspace_for_cwd(&self, cwd: &Path) -> String

Workspace id from /v1/identity for cwd, or dir:<abs> if that call fails.

Source

pub fn health(&self) -> Result<String, Error>

Source

pub fn get_atom(&self, workspace: &str, id: &str) -> Result<Value, Error>

Source

pub fn list_atoms(&self, workspace: &str) -> Result<Vec<Value>, Error>

Source

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.

Source

pub fn search( &self, workspace: &str, q: &str, limit: u32, ) -> Result<Vec<Hit>, Error>

Source

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.

Source

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.

Source

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.

Source

pub fn pin(&self, workspace: &str) -> Result<Value, Error>

The set a workspace is pinned to.

§Errors

The request’s, or a body that is not JSON.

Source

pub fn set_pin(&self, workspace: &str, name: &str) -> Result<Value, Error>

Pin a workspace to a set.

§Errors

The request’s, or a body that is not JSON.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn grade( &self, workspace: &str, id: &str, recalled: bool, ) -> Result<Value, Error>

Move one atom along the review clock: recalled, or lapsed.

Source

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.

Source

pub fn islands(&self, workspace: &str) -> Result<Value, Error>

Source

pub fn fire(&self, workspace: &str, ids: &[String]) -> Result<Value, Error>

Claims that fired together: their links gain weight.

Source

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.

Source

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.

Source

pub fn post_atom(&self, atom: &Value) -> Result<Value, Error>

Trait Implementations§

Source§

impl Clone for PacksetClient

Source§

fn clone(&self) -> PacksetClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PacksetClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.