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
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.
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 overlay_omissions(&self) -> Result<Vec<Omission>, Error>
pub fn overlay_omissions(&self) -> Result<Vec<Omission>, Error>
Recorded peer omissions; HTTP 404 is Error::Invalid("overlay disabled").
Sourcepub fn overlay_book(&self) -> Result<Vec<BookEntry>, Error>
pub fn overlay_book(&self) -> Result<Vec<BookEntry>, Error>
The peer book’s routing hints; HTTP 404 is Error::Invalid("overlay disabled").
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 an explicitly located genesis with the local operator. This is a local index acknowledgement, not independent evidence or permanent state. HTTP 409 remains Busy; a possibly committed operation is never retried.
Sourcepub fn names_step(&self, genesis: Txid) -> Result<NamesStep, Error>
pub fn names_step(&self, genesis: Txid) -> Result<NamesStep, Error>
Request one local Names step and read operator outcomes. No independent proof, automatic stepping, retry or readback; HTTP 409 remains Busy.
Sourcepub fn names_status(&self, genesis: Txid) -> Result<Option<NamesStatus>, Error>
pub fn names_status(&self, genesis: Txid) -> Result<Option<NamesStatus>, Error>
Read operator Names progress. None means only locally unregistered (404), not global absence. No stepping or retry; HTTP 409 remains Busy.
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 local operator resolution for a canonical name, not independent ownership evidence or permanent state. No stepping/retry; 409 remains Busy.
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 local operator Names page, not independent chain/registry evidence. The consumer checks its expected chain and metadata consistency across pages. No automatic paging, stepping or retry; 409 remains Busy and ends traversal. Absent continuation ends only the local snapshot, not chain completeness.
Trait Implementations§
Source§impl RecordSource for Client
Fetch data only from the explicitly configured local operator endpoint.
This adapter performs no peer or network discovery. The receiving engine
independently verifies the package against its own selected headers.
impl RecordSource for Client
Fetch data only from the explicitly configured local operator endpoint. This adapter performs no peer or network discovery. The receiving engine independently verifies the package against its own selected headers.
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more