pub struct PgStore { /* private fields */ }Expand description
The store on PostgreSQL, with a connection pool. Send + Sync: share one per process
(behind an Arc); each call checks a connection out for its duration.
Every put_* is one transaction. Store methods return errors: a malformed argument
is Error::Invalid (no query is made), a database failure Error::Database. The
Resolver methods answer both with None; a database failure is logged with
tracing (target datumesh_store, level error).
Implementations§
Source§impl PgStore
impl PgStore
Sourcepub fn connect(url: &str) -> Result<PgStore>
pub fn connect(url: &str) -> Result<PgStore>
Connects to a postgres:// URL or key=value connection string with the default
PoolOptions: connect_with(url, PoolOptions::new()).
Sourcepub fn connect_with(url: &str, options: PoolOptions) -> Result<PgStore>
pub fn connect_with(url: &str, options: PoolOptions) -> Result<PgStore>
Connects to a postgres:// URL or key=value connection string, with a pool and TLS
roots as options say. One connection is opened at once, so a wrong URL, an
unreachable server or a refused certificate fails here; nothing else is done on it
(no statement is prepared, the schema is not looked at), so an empty database is fine
(create the schema with migrate::apply).
TLS (rustls) is used as the URL’s sslmode says: disable never, prefer (the
default) when the server offers it, require always. Whenever it is used, the
server’s certificate and host name are verified, against the Mozilla roots plus the
roots added with PoolOptions::tls_root_certificates_pem; there is no way to
accept any certificate. So a server with ssl=on and a self-signed certificate (or
one from a private CA) fails even under the default prefer: add its CA, or connect
with sslmode=disable.
Sourcepub fn check_statements(&self) -> Result<usize>
pub fn check_statements(&self) -> Result<usize>
Prepares every SQL statement the store uses against the live schema, on a fresh connection’s behalf (no cached statement is reused), and returns how many there are. Fails with the first statement the schema cannot serve.
Trait Implementations§
Source§impl Resolver for PgStore
impl Resolver for PgStore
Source§fn manifest(&self, entry: &str) -> Option<Cow<'_, [u8]>>
fn manifest(&self, entry: &str) -> Option<Cow<'_, [u8]>>
The stored manifest of slice entry entry (Store::put_manifest), its canonical
form; None when there is none, or entry is not an entry (since 0.3.1).
Source§fn evaluate(&self, cell: &Cell, asof: &str) -> Option<Scalar>
fn evaluate(&self, cell: &Cell, asof: &str) -> Option<Scalar>
Some only for a stored function (descriptor code.lang is stored, and the store
has the descriptor): the value of the receipt of the version that answers as of
asof, stored_asof’s: the latest version (by tx) with tx <= asof whose receipt’s asof is also <= asof (the core’s testkit
AnswerRule::TxAndAsof). None for every other function, and when no version
answers. (Until 0.2.0 it looked at tx only, as version_asof
still does; the same when every receipt’s asof is its tx.)
Source§fn descriptor(&self, fn_hash: &str) -> Option<Cow<'_, [u8]>>
fn descriptor(&self, fn_hash: &str) -> Option<Cow<'_, [u8]>>
fn_hash, or None if unavailable
(E_FN_UNAVAILABLE). Only None is unavailability: the text is parsed strictly
(unparseable text reports its parse code), and any other JSON value, null included,
is a descriptor offered that fails the hash check (E_FN_HASH_MISMATCH, SPEC 10.1
step 7.1).Source§fn receipt(&self, hash: &str) -> Option<Cow<'_, [u8]>>
fn receipt(&self, hash: &str) -> Option<Cow<'_, [u8]>>
hash, or None if unavailable
(E_INPUT_UNAVAILABLE).Source§fn evaluation(&self, cell: &Cell, asof: &str) -> Option<Evaluation>
fn evaluation(&self, cell: &Cell, asof: &str) -> Option<Evaluation>
cell as of asof, with the evaluation’s lineage when the resolver has it:
the inputs entries the evaluation read (10.1 step 7.6). verify calls this once,
in place of evaluate. When the value differs from the receipt’s,
a lineage that replaces one of the receipt’s inputs by a later version of the same cell
(whose receipt it offers through receipt), or one of its slice
entries by an item beginning slice:<the same slice id>:, makes the result
E_INPUT_SUPERSEDED instead of E_VALUE_MISMATCH. Provided: evaluate’s value, with
no lineage.Source§impl Store for PgStore
impl Store for PgStore
Source§fn computed_asof_with_receipt(
&self,
cell_id: &str,
asof: &str,
) -> Result<Option<(Version, Cow<'_, [u8]>)>>
fn computed_asof_with_receipt( &self, cell_id: &str, asof: &str, ) -> Result<Option<(Version, Cow<'_, [u8]>)>>
One query: the version and its receipt’s bytes.
Source§fn stored_asof_with_receipt(
&self,
cell_id: &str,
asof: &str,
) -> Result<Option<(Version, Cow<'_, [u8]>)>>
fn stored_asof_with_receipt( &self, cell_id: &str, asof: &str, ) -> Result<Option<(Version, Cow<'_, [u8]>)>>
One query: the version and its receipt’s bytes.
Source§fn put_descriptor(&self, bytes: &[u8]) -> Result<String>
fn put_descriptor(&self, bytes: &[u8]) -> Result<String>
Source§fn put_receipt(&self, bytes: &[u8]) -> Result<String>
fn put_receipt(&self, bytes: &[u8]) -> Result<String>
put_namespace, in canonical form,
with an edge to each of its inputs; returns its hash. An input that is a slice entry
(slice:<slice id>:<members hash>, since 0.3.1) is recorded as such
(slice_entries); its manifest need not be stored, before or
after (it is needed only to recompute, SPEC 10.1 step 7.5). The receipt’s cell is
indexed by its typed arguments (slice_members). A receipt that does not verify
is refused with verify’s code (no key document for the host: E_KEY_UNAVAILABLE).
Idempotent: bytes whose canonical form is the stored copy return its hash without
checking the signature again (it verified when stored), even if the key has since
been revoked. Other bytes with a stored hash are verified first, then refused as
Error::Conflict.Source§fn put_blob(&self, bytes: &[u8]) -> Result<String>
fn put_blob(&self, bytes: &[u8]) -> Result<String>
Source§fn put_version(&self, cell_id: &str, tx: &str, receipt_hash: &str) -> Result<()>
fn put_version(&self, cell_id: &str, tx: &str, receipt_hash: &str) -> Result<()>
tx on, cell_id has the value of receipt receipt_hash,
which must be stored, of that cell and at that tx. tx must be later than the cell’s
latest version (Error::NotLater).Source§fn version_asof(&self, cell_id: &str, asof: &str) -> Result<Option<Version>>
fn version_asof(&self, cell_id: &str, asof: &str) -> Result<Option<Version>>
tx <= asof.Source§fn versions(&self, cell_id: &str, from: &str, to: &str) -> Result<Vec<Version>>
fn versions(&self, cell_id: &str, from: &str, to: &str) -> Result<Vec<Version>>
from <= tx <= to, in tx order.Source§fn latest_many(&self, cell_ids: &[&str]) -> Result<Vec<Option<Version>>>
fn latest_many(&self, cell_ids: &[&str]) -> Result<Vec<Option<Version>>>
latest of each of cell_ids, in input order (duplicates allowed;
empty input, empty result). The first malformed id is the error. Since 0.4.3.Source§fn receipts_many(&self, hashes: &[&str]) -> Result<Vec<Option<Vec<u8>>>>
fn receipts_many(&self, hashes: &[&str]) -> Result<Vec<Option<Vec<u8>>>>
receipt of each of hashes, in input order, as owned bytes.
Since 0.4.3.Source§fn put_cells(&self, items: &[CellWrite<'_>]) -> Result<Vec<String>>
fn put_cells(&self, items: &[CellWrite<'_>]) -> Result<Vec<String>>
put_receipt and then, when the item
has a version, put_version; returns the receipt hashes.
All or nothing on PostgreSQL (one transaction; calls of up to 10,000 items are the
size it is written for). SQLite (and this default) loops, stops at the first error,
and need not be atomic: the items before a failing one stay stored there. Since 0.4.3.Source§fn dependents(&self, receipt_hash: &str) -> Result<Vec<String>>
fn dependents(&self, receipt_hash: &str) -> Result<Vec<String>>
receipt_hash among their inputs, by hash. Only as
an input of its own: a receipt read as a member of a slice is found through its
manifests (member_manifests, then
slice_dependents).Source§fn inputs(&self, receipt_hash: &str) -> Result<Vec<String>>
fn inputs(&self, receipt_hash: &str) -> Result<Vec<String>>
slice_entries.Source§fn put_namespace(
&self,
host: &str,
keydoc_bytes: &[u8],
validated_at: &str,
) -> Result<()>
fn put_namespace( &self, host: &str, keydoc_bytes: &[u8], validated_at: &str, ) -> Result<()>
validated_at. Re-validation replaces the document; a
validated_at earlier than the recorded one is Error::NotLater. Receipts already
stored are not re-checked: they verified when they were stored (and putting one again
stays idempotent).Source§fn namespaces(&self) -> Result<Vec<Namespace>>
fn namespaces(&self) -> Result<Vec<Namespace>>
Source§fn record_namespace_failure(
&self,
host: &str,
checked_at: &str,
threshold: u32,
) -> Result<Option<Namespace>>
fn record_namespace_failure( &self, host: &str, checked_at: &str, threshold: u32, ) -> Result<Option<Namespace>>
host’s key document at checked_at (domain validation):
the consecutive failures grow by one, and when they reach threshold (zero counts as
one) the namespace is suspended at checked_at, unless it already is (the first
suspension’s time is kept). While it is suspended the store refuses new writes under
the host: put_receipt of a receipt signed by it, put_version of such a receipt
and bind_name of a name under it (Error::NamespaceSuspended); reads,
verification and the stored key document are not affected, and neither is putting a
receipt that is already stored. Returns the namespace as recorded, or None for a
host with no namespace (there is nothing to suspend). A checked_at earlier than the
latest check is Error::NotLater. Since the namespace checks (since 0.4.1).Source§fn record_namespace_success(
&self,
host: &str,
checked_at: &str,
) -> Result<Option<Namespace>>
fn record_namespace_success( &self, host: &str, checked_at: &str, ) -> Result<Option<Namespace>>
host’s key document at checked_at: the consecutive
failures are reset to zero and a suspension is lifted (the namespace is reinstated).
The document itself is recorded with put_namespace (which
neither suspends nor reinstates). Returns the namespace as recorded, or None for a
host with no namespace. A checked_at earlier than the latest check is
Error::NotLater. Since the namespace checks (since 0.4.1).Source§fn bind_name(&self, fn_name: &str, fn_hash: &str, tx: &str) -> Result<()>
fn bind_name(&self, fn_name: &str, fn_hash: &str, tx: &str) -> Result<()>
tx on, the fully qualified function name fn_name means
fn_hash, whose descriptor must be stored. tx must be later than the name’s latest
binding (Error::NotLater).Source§fn put_computed(
&self,
cell_id: &str,
tx: &str,
receipt_hash: &str,
) -> Result<()>
fn put_computed( &self, cell_id: &str, tx: &str, receipt_hash: &str, ) -> Result<()>
receipt_hash (stored, a receipt of cell_id at tx) is a computed
version of the cell. Insert-only, in any order (an older version may be added after a
newer one): tx need not be later than anything. The version’s asof is the
receipt’s. Idempotent for the same (cell_id, tx, asof, receipt_hash); another receipt
for an existing (cell_id, tx, asof) is Error::Conflict (its hash is the receipt
refused) and the stored one is kept. The receipt is checked as for
put_version: Error::NotFound when it is not stored,
Error::Mismatch when it is of another cell or at another tx. Since 0.2.0.Source§fn computed_asof(&self, cell_id: &str, asof: &str) -> Result<Option<Version>>
fn computed_asof(&self, cell_id: &str, asof: &str) -> Result<Option<Version>>
asof: the one with the greatest asof <=
asof (between equal asof, the greatest tx), or None. Since 0.2.0.Source§fn stored_asof(&self, cell_id: &str, asof: &str) -> Result<Option<Version>>
fn stored_asof(&self, cell_id: &str, asof: &str) -> Result<Option<Version>>
asof: the latest version (by tx) with tx <= asof whose receipt’s asof is also <= asof, or None. A version whose receipt is
late-signed (asof later than tx) answers only from its asof on; until then the
version before it answers. (version_asof keeps its tx-only
meaning.) Since 0.2.0.Source§fn cell_dependents(&self, cell_id: &str) -> Result<Vec<String>>
fn cell_dependents(&self, cell_id: &str) -> Result<Vec<String>>
cell_id: the cell ids of the stored receipts that list, among
their inputs, any stored receipt of cell_id (lineage: edges joined to receipts),
or (since 0.3.1) a slice entry whose stored manifest lists one as a member.
Ascending, each once. Since 0.2.0.Source§fn put_manifest(&self, bytes: &[u8]) -> Result<String>
fn put_manifest(&self, bytes: &[u8]) -> Result<String>
{"members": [...], "slice": {...}}: parsed strictly
and checked by the core (Manifest::from_json: structure, members, their order and
limit, the slice object), kept in canonical form under its entry
slice:<slice id>:<members hash>, which it returns, and recorded for each member
(member_manifests). The members need not be stored.
Idempotent; insert-only (the entry is a hash of the content, so a stored entry
always has these bytes). Served by manifest. Since 0.3.1.Source§fn member_manifests(&self, receipt_hash: &str) -> Result<Vec<String>>
fn member_manifests(&self, receipt_hash: &str) -> Result<Vec<String>>
receipt_hash among their members,
ascending: from a member, the slices it was read in (then
slice_dependents). Since 0.3.1.Source§fn slice_entries(&self, receipt_hash: &str) -> Result<Vec<String>>
fn slice_entries(&self, receipt_hash: &str) -> Result<Vec<String>>
Source§fn slice_dependents(&self, entry: &str) -> Result<Vec<String>>
fn slice_dependents(&self, entry: &str) -> Result<Vec<String>>
entry, by hash, ascending.
An entry is slice: and two 64-digit hashes (E_CANON_HEX otherwise). Since 0.3.1.Source§fn slice_members(&self, slice: &Slice, asof: &str) -> Result<Vec<SliceMember>>
fn slice_members(&self, slice: &Slice, asof: &str) -> Result<Vec<SliceMember>>
slice as of asof (SPEC 15.13), with the stored version of each
that answers as of asof and its receipt’s bytes. Read moreSource§fn versions_between(
&self,
cell_id: &str,
from: &str,
to: &str,
asof: &str,
) -> Result<Vec<SliceMember>>
fn versions_between( &self, cell_id: &str, from: &str, to: &str, asof: &str, ) -> Result<Vec<SliceMember>>
cell_id with from <= tx <= to that answer as of asof
(tx <= asof and the receipt’s asof <= asof), ascending by tx, each with its
receipt’s bytes: SPEC 15.13’s version slice. Empty when from is after to. Since
0.3.1.Source§fn slice_values(&self, slice: &Slice, asof: &str) -> Result<Vec<SliceValue>>
fn slice_values(&self, slice: &Slice, asof: &str) -> Result<Vec<SliceValue>>
slice_members gives, in its order and by its
answering rule, each as its version, its receipt’s typed value and its cell (with its
arguments), without the receipt’s bytes (the value is a stored column of the receipt
and the cell comes from the typed-argument index, neither parsed per call).
Since 0.3.2.Source§fn slice_changed_after(&self, slice: &Slice, asof: &str) -> Result<bool>
fn slice_changed_after(&self, slice: &Slice, asof: &str) -> Result<bool>
slice, or their versions, may answer differently as of some
time after asof: whether a cell matching the slice has a stored version whose
receipt’s asof is after asof (its tx is never later than that), for a version
slice one with tx in [from, to]. false means slice_members
(and slice_values) give the same answer as of every time from asof on, until a
version is stored with an asof after it; true may be conservative (a late-signed
version superseded before its asof never answers). Index scans only, whatever the
slice’s size: two bounded probes (at most 10,001 entries each) choose whether to walk
the function’s receipts with an asof after asof or the slice’s candidate cells,
whichever is fewer, and one query walks it, stopping at the first match. Since 0.3.2.Source§fn computed_cells(
&self,
slice: &Slice,
asof: &str,
limit: usize,
) -> Result<Vec<Cell>>
fn computed_cells( &self, slice: &Slice, asof: &str, limit: usize, ) -> Result<Vec<Cell>>
slice (matched as slice_values matches them: the
fixed arguments, fn_hash, ns, fn and the number of arguments) that have a computed
version answering as of asof: one with tx <= asof whose receipt’s asof is <= asof
(the rule of computed_asof). Ascending by cell id, at most
limit (slice_values takes no limit), each with its arguments from the typed-argument
index. A cell with only a stored version is not returned. Since 0.4.2.Source§fn has_bindings_under(&self, namespace: &str) -> Result<bool>
fn has_bindings_under(&self, namespace: &str) -> Result<bool>
namespace and /
(so "a.example/n" is not a namespace of "a.example/ns/f"). Since 0.4.2.Source§fn put_class(&self, bytes: &[u8]) -> Result<String>
fn put_class(&self, bytes: &[u8]) -> Result<String>
Source§fn class(&self, class_hash: &str) -> Result<Option<Vec<u8>>>
fn class(&self, class_hash: &str) -> Result<Option<Vec<u8>>>
put_class); None when no such class is stored. A malformed
hash is E_CANON_HEX. Never refused under a suspended namespace. Since 0.4.1.Source§fn bind_class(&self, class_name: &str, class_hash: &str, tx: &str) -> Result<()>
fn bind_class(&self, class_name: &str, class_hash: &str, tx: &str) -> Result<()>
class_name (a full name, 2.3) to the stored class class_hash
from tx on and, in the same transaction, binds each method <class_name>/<m> of the
stored (flattened, so inherited methods included) descriptor to the method’s function
hash from the same tx (SPEC 16.3, 9.7). All of it or nothing: Read moreSource§fn resolve_class(&self, class_name: &str, asof: &str) -> Result<Option<String>>
fn resolve_class(&self, class_name: &str, asof: &str) -> Result<Option<String>>
class_name meant as of asof: the hash of
resolve_class_binding’s binding. None before the
first binding, and for a name whose binding as of asof is a function’s. Since 0.4.1.Source§fn resolve_class_binding(
&self,
class_name: &str,
asof: &str,
) -> Result<Option<ClassBinding>>
fn resolve_class_binding( &self, class_name: &str, asof: &str, ) -> Result<Option<ClassBinding>>
class_name that answers as of asof: the latest with
tx <= asof, with its class hash and its tx (when it began; binding the same hash
again begins again), as resolve_binding does for functions.
None before the first, and for a function name. The function accessors
(resolve_name, resolve_binding)
answer None for a class name: a bindings answer (9.7) has fn_hash or class_hash,
never both. Since 0.4.1.Source§fn resolve_binding(&self, fn_name: &str, asof: &str) -> Result<Option<Binding>>
fn resolve_binding(&self, fn_name: &str, asof: &str) -> Result<Option<Binding>>
fn_name that answers as of asof: the one with the latest tx <= asof, with its function hash and its tx, when it began; None before the first.
A name bound again to a hash it meant before (even the hash of the binding before
it) begins again: the later binding’s tx. Since 0.3.0.Source§fn upsert_catalog(&self, entries: &[CatalogEntry]) -> Result<Vec<i64>>
fn upsert_catalog(&self, entries: &[CatalogEntry]) -> Result<Vec<i64>>
hash as 64 hex digits, the bounds of CatalogEntry) and refused with
Error::Invalid before anything is written. An operator’s entry never replaces a
publisher’s: that entry is kept, and the call still answers its id. A publisher’s
replaces either. Replacing an entry’s label or description drops its embedding.
Since 0.5.0.Source§fn upsert_key_values(
&self,
owner: &str,
key: &str,
values: &[KeyValue],
) -> Result<Vec<i64>>
fn upsert_key_values( &self, owner: &str, key: &str, values: &[KeyValue], ) -> Result<Vec<i64>>
key of owner (a function or class name): each
value’s label and aliases are replaced, and its n_cells is kept. Values not in
values stay (an upsert adds and replaces, it does not prune). Returns each value’s
id, in order. Replacing a value’s label drops its embedding. Since 0.5.0.Source§fn refresh_value_counts(&self) -> Result<u64>
fn refresh_value_counts(&self) -> Result<u64>
n_cells to the number of cells of the function named
by its owner that have that value for the key; returns the number of rows refreshed
(every value, changed or not). Since 0.5.0.Source§fn text_find(&self, query: &str, limit: usize) -> Result<Vec<Hit>>
fn text_find(&self, query: &str, limit: usize) -> Result<Vec<Hit>>
query (split on white
space; a word matches case-insensitively, literally, in any field of the entry or
value, and scores 1.0 as a whole field, 0.8 as one of a field’s words, 0.5 inside a
field; a score is the mean over the words, in (0, 1]). Best first, ties by name; at
most limit. A blank query finds nothing. Since 0.5.0.Source§fn vector_find(
&self,
model: &str,
vec: &[f32],
limit: usize,
) -> Result<Vec<Hit>>
fn vector_find( &self, model: &str, vec: &[f32], limit: usize, ) -> Result<Vec<Hit>>
vec by cosine similarity, among those with an
embedding for model: each score is 1 minus the cosine distance (1.0 for the same
direction), best first, at most limit. vec has 384 finite values, not all zero
(Error::Invalid otherwise). Error::Unsupported where
vector_available is false. Since 0.5.0.Source§fn put_embeddings(&self, model: &str, items: &[Embedding]) -> Result<()>
fn put_embeddings(&self, model: &str, items: &[Embedding]) -> Result<()>
model, one per (kind, id, model): an existing one is replaced.
All or nothing; a reference to an entry or value that is not stored is
Error::NotFound, and a vector is checked as vector_find
checks it. Error::Unsupported where vector_available is false. Since 0.5.0.Source§fn pending_embeddings(
&self,
model: &str,
limit: usize,
) -> Result<Vec<PendingEmbedding>>
fn pending_embeddings( &self, model: &str, limit: usize, ) -> Result<Vec<PendingEmbedding>>
limit entries and values with no embedding for model, with the text to embed
(see PendingEmbedding). Empty where vector_available is false (nothing can be
stored there). Since 0.5.0.Source§fn vector_available(&self) -> bool
fn vector_available(&self) -> bool
vector
extension, where the migration made the embeddings table. Looked at when the store
is opened (migrate before opening, as the schema is then in place). Since 0.5.0.Source§fn log_miss(&self, query: &str) -> Result<()>
fn log_miss(&self, query: &str) -> Result<()>
FIND_MISSES_CAP rows, pruning the oldest. Since 0.5.0.Source§fn put_function_test(&self, test: &FunctionTest) -> Result<bool>
fn put_function_test(&self, test: &FunctionTest) -> Result<bool>
Ok(true) when the row is
inserted, Ok(false) when one exists, in which case nothing changes (the first
writer’s signed_by and test_json stay). The test is checked first: a 64-digit
hash, a 16-digit case, a canonical test_json, a signer of 1 to 256 bytes, an instant
and result if it carries them, and branch counts with covered not above total, each
at most i32::MAX; a failing check is Error::Invalid and nothing is stored.
Since 0.5.1.Source§fn function_tests(&self, fn_hash: &str) -> Result<Vec<FunctionTest>>
fn function_tests(&self, fn_hash: &str) -> Result<Vec<FunctionTest>>
fn_hash, ordered by case ascending; empty when there are none. Since 0.5.1.Source§fn record_function_test(
&self,
fn_hash: &str,
case: &str,
run_at: &str,
result: &str,
detail: &str,
) -> Result<bool>
fn record_function_test( &self, fn_hash: &str, case: &str, run_at: &str, result: &str, detail: &str, ) -> Result<bool>
fn_hash, case): sets its last_run_at (the instant
run_at), last_result and last_detail. Ok(true) when the test exists; Ok(false)
when it does not, and nothing is inserted. result must be pass, fail or error:
any other value is Error::Invalid, and nothing changes. Since 0.5.1.Source§fn set_function_branches(
&self,
fn_hash: &str,
total: u32,
covered: u32,
) -> Result<()>
fn set_function_branches( &self, fn_hash: &str, total: u32, covered: u32, ) -> Result<()>
branches_total and branches_covered on every test of fn_hash. A function
with no tests is a no-op, not an error. covered above total is Error::Invalid.
Since 0.5.1.Source§fn function_readers(&self, name: &str) -> Result<Vec<String>>
fn function_readers(&self, name: &str) -> Result<Vec<String>>
inputs contain name (a fully
qualified function name), distinct, ascending. Answered from the index of descriptor
inputs, which put_descriptor fills; the migration that
introduced the index filled it from the descriptors stored before. Since 0.5.1.Source§fn bound_names(&self, fn_hash: &str) -> Result<Vec<String>>
fn bound_names(&self, fn_hash: &str) -> Result<Vec<String>>
bind_name) to
fn_hash, distinct, ascending. A name since bound to another hash still lists this
one. Since 0.5.1.Source§fn name_function_tests(
&self,
fn_hash: &str,
names: &[(String, String)],
) -> Result<u64>
fn name_function_tests( &self, fn_hash: &str, names: &[(String, String)], ) -> Result<u64>
fn_hash: each (case, fn_name) names the test of
that case, if it has no name yet. A name once set is never changed, and a case with no
test changes nothing. Returns the number of tests named (rows changed); an empty list
is 0. The default is Error::Unsupported. Since 0.5.2.Source§fn unnamed_function_tests(&self, limit: usize) -> Result<Vec<FunctionTest>>
fn unnamed_function_tests(&self, limit: usize) -> Result<Vec<FunctionTest>>
limit tests that have no function name, ordered by (function hash, case), each
as function_tests gives it. Naming them drains the list. The
default is Error::Unsupported. Since 0.5.2.Source§fn function_test_summary(
&self,
fn_hash: &str,
fn_name: Option<&str>,
) -> Result<TestSummary>
fn function_test_summary( &self, fn_hash: &str, fn_name: Option<&str>, ) -> Result<TestSummary>
fn_hash in one aggregate: every test of the hash when
fn_name is None, else only those named fn_name. A hash with no such test gives the
zero summary (TestSummary::default). The default computes it from
function_tests when fn_name is None, and is
Error::Unsupported for a name (0.5.1 does not give a test’s name). Since 0.5.2.Source§fn function_tests_page(
&self,
fn_hash: &str,
fn_name: Option<&str>,
after_case: Option<&str>,
limit: usize,
) -> Result<Vec<FunctionTest>>
fn function_tests_page( &self, fn_hash: &str, fn_name: Option<&str>, after_case: Option<&str>, limit: usize, ) -> Result<Vec<FunctionTest>>
fn_hash by case ascending: those named fn_name (or all, when
None), with a case after after_case (exclusive, when given), at most limit.
Whole rows, as function_tests gives them. The default is the
page of function_tests when fn_name is None, and is
Error::Unsupported for a name. Since 0.5.2.Source§fn stored_receipts_of(
&self,
ns: &str,
fn_name: &str,
fn_hash: &str,
limit: usize,
) -> Result<Vec<Vec<u8>>>
fn stored_receipts_of( &self, ns: &str, fn_name: &str, fn_hash: &str, limit: usize, ) -> Result<Vec<Vec<u8>>>
receipt returns them) of the latest
stored version of up to limit cells of ns/fn_name/fn_hash that have one, lowest
cell id first: at most limit cells are read. The default is Error::Unsupported
(0.5.1 has no read of a function’s cells without a slice). Since 0.5.2.Source§fn slice_values_limit(
&self,
slice: &Slice,
asof: &str,
limit: usize,
) -> Result<Vec<SliceValue>>
fn slice_values_limit( &self, slice: &Slice, asof: &str, limit: usize, ) -> Result<Vec<SliceValue>>
slice_values with at most limit members: the first limit of
its order (the same members, in the same order). The default takes them from
slice_values. Since 0.5.2.Source§fn versions_limit(
&self,
cell_id: &str,
from: &str,
to: &str,
limit: usize,
) -> Result<Vec<Version>>
fn versions_limit( &self, cell_id: &str, from: &str, to: &str, limit: usize, ) -> Result<Vec<Version>>
versions with at most limit versions: the first limit, in tx
order. The default takes them from versions. Since 0.5.2.Source§fn stored_cell_count(
&self,
ns: &str,
fn_name: &str,
fn_hash: &str,
) -> Result<u64>
fn stored_cell_count( &self, ns: &str, fn_name: &str, fn_hash: &str, ) -> Result<u64>
ns/fn_name/fn_hash that have a stored version (a second
version of a cell is not a second cell). The default is Error::Unsupported. Since
0.5.2.Source§fn has_key_value(&self, owner: &str, key: &str, value: &str) -> Result<bool>
fn has_key_value(&self, owner: &str, key: &str, value: &str) -> Result<bool>
owner has the dictionary value value for key, exactly (the value’s text,
case-sensitive; no prefix, substring or label match). Indexed in the native stores. The
default asks text_find for value and keeps the exact match.
Since 0.5.2.Source§fn mark_key_open(&self, owner: &str, key: &str) -> Result<()>
fn mark_key_open(&self, owner: &str, key: &str) -> Result<()>
key of owner open: it takes no automatic values from now on. Marking
an open key again changes nothing. Its existing values stay. The default is
Error::Unsupported. Since 0.5.2.Source§fn open_key_count(&self) -> Result<u64>
fn open_key_count(&self) -> Result<u64>
mark_key_open).
The default is 0, which is exact for a store with no open key. Since 0.5.2.Source§fn key_is_open(&self, owner: &str, key: &str) -> Result<bool>
fn key_is_open(&self, owner: &str, key: &str) -> Result<bool>
key of owner has been marked open (mark_key_open).
The default is Error::Unsupported. Since 0.5.2.Source§fn catalog_entry(&self, name: &str) -> Result<Option<CatalogEntry>>
fn catalog_entry(&self, name: &str) -> Result<Option<CatalogEntry>>
name (exactly), if there is one. A name may be the name of a
function and of a class; the function’s entry is given first, then a method’s, then a
class’s. The default is Error::Unsupported. Since 0.5.2.