pub struct Client { /* private fields */ }Expand description
An optional local service connection, trusting the configured local operator. Construction performs no I/O. Each operation opens one bounded connection.
Implementations§
Source§impl Client
impl Client
Source§impl Client
impl Client
pub fn new(address: SocketAddr, token: String) -> Result<Self, Error>
Sourcepub fn status(&self) -> Result<ServiceStatus, Error>
pub fn status(&self) -> Result<ServiceStatus, Error>
Typed service status reported by the local operator, without verifying its claims. Unknown fields from a newer operator are ignored.
Sourcepub fn status_json(&self) -> Result<Value, Error>
pub fn status_json(&self) -> Result<Value, Error>
Raw status JSON reported by the local operator, without verifying its claims.
Sourcepub fn record(&self, txid: Txid) -> Result<Option<ArchivedRecord>, Error>
pub fn record(&self, txid: Txid) -> Result<Option<ArchivedRecord>, Error>
Read locally archived data. None means HTTP 404 (not locally available),
not proof that a record does not exist. Authentication and other failures
remain errors. Only the receipt’s TXID is compared with the requested ID.
The chain is unknown here: reveal decoding, TXID/witness recomputation,
inclusion and URMA verification belong to independent admission through
Engine::admit_record. Deserialization does not establish those claims.
Sourcepub fn object_status(&self, root: Txid) -> Result<Option<ObjectStatus>, Error>
pub fn object_status(&self, root: Txid) -> Result<Option<ObjectStatus>, Error>
Read object availability reported by the configured local operator.
These are operator data, not independently verified chain evidence.
Selected member count is independent of local retention: either count
may exceed the other, but both must be within a nonzero member total.
None means only that no completed object is recorded locally (HTTP 404),
not global absence. Root/count sanity checks establish no crypto claims.
Sourcepub fn set_pin(&self, root: Txid, pin: bool) -> Result<PinReceipt, Error>
pub fn set_pin(&self, root: Txid, pin: bool) -> Result<PinReceipt, Error>
Request a local pin or unpin and read the operator’s acknowledgement at its commit point. This is not cryptographic evidence or a promise of future availability, chain selection or pin state. Only HTTP 200 with the requested root and pin value succeeds. No automatic retry occurs: the operation may already have committed before a socket failure.
Sourcepub fn prune_cache(&self) -> Result<PruneReceipt, Error>
pub fn prune_cache(&self) -> Result<PruneReceipt, Error>
Request explicit local cache pruning and read the operator’s removal count. This acknowledgement is not cryptographic evidence or a promise of future cache contents. Only HTTP 200 succeeds. No automatic retry occurs, including when a socket failure leaves the commit outcome unknown.
Sourcepub fn wire_page(
&self,
cursor: Option<&WireCursor>,
limit: u32,
) -> Result<WirePage, Error>
pub fn wire_page( &self, cursor: Option<&WireCursor>, limit: u32, ) -> Result<WirePage, Error>
Read one bounded page of Wire records from the configured local operator.
Entry parsing checks data consistency, not authorship or chain inclusion.
Selected records and scanned coverage remain separate; next == None
ends only the local result set and does not establish chain completeness.
A snapshot is opaque. HTTP 409 returns Error::Busy: discard the partial
traversal and explicitly restart. No paging, retry or readback is automatic.
Sourcepub fn register_names(
&self,
genesis: Txid,
block: ChainPoint,
) -> Result<NamesStatus, Error>
pub fn register_names( &self, genesis: Txid, block: ChainPoint, ) -> Result<NamesStatus, Error>
Register one explicitly located Names genesis with the local operator.
The acknowledgement describes a local index, not independently verified
chain evidence or permanent registration/state. HTTP 409 is Error::Busy.
Heights above i64::MAX are refused before any I/O.
No retry occurs: registration may commit before a response is lost.
Sourcepub fn names_step(&self, genesis: Txid) -> Result<NamesStep, Error>
pub fn names_step(&self, genesis: Txid) -> Result<NamesStep, Error>
Request exactly one local Names projection step. Returned outcomes are
operator data, not cryptographic proofs or a promise of future state.
HTTP 409 is Error::Busy; no automatic stepping, retry or readback occurs,
including when a lost response leaves the operation’s commit unknown.
Sourcepub fn names_status(&self, genesis: Txid) -> Result<Option<NamesStatus>, Error>
pub fn names_status(&self, genesis: Txid) -> Result<Option<NamesStatus>, Error>
Read the configured operator’s local Names progress. HTTP 404 means only
that this registry is not registered locally, not global absence. Typed
progress and completion are not independent chain evidence. HTTP 409 is
Error::Busy; no registration, stepping or retry is performed.
Sourcepub fn names_resolve(
&self,
genesis: Txid,
name: &Name,
) -> Result<NamesResolution, Error>
pub fn names_resolve( &self, genesis: Txid, name: &Name, ) -> Result<NamesResolution, Error>
Read a canonical name’s resolution from the local operator. This is
index data, not independent proof of ownership, coverage or future state.
The DTO carries no returned name to compare with the request. HTTP 409 is
Error::Busy; resolution never automatically steps or retries.
Sourcepub fn names_view(
&self,
genesis: Txid,
cursor: Option<&NamesCursor>,
limit: u32,
) -> Result<NamesPage, Error>
pub fn names_view( &self, genesis: Txid, cursor: Option<&NamesCursor>, limit: u32, ) -> Result<NamesPage, Error>
Read one Names view page supplied by the configured local operator.
State decoding and page consistency checks are not independent chain or
registry evidence. The consumer must check its expected chain genesis and
identical metadata across pages. No paging, stepping or retry is automatic.
HTTP 409 is Busy: discard the partial traversal and explicitly restart.
next == None ends this local snapshot only, not a chain completeness claim.