Skip to main content

Client

Struct Client 

Source
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

Source

pub fn overlay_omissions(&self) -> Result<Vec<Omission>, Error>

The newest (highest) omissions recorded by the operator’s scans, at most 1024, ascending by height. HTTP 404 (a daemon without the overlay routes) is Error::Invalid("overlay disabled").

Source

pub fn overlay_book(&self) -> Result<Vec<BookEntry>, Error>

The operator’s peer book: untrusted routing hints, at most 1024 entries of one to four addresses. HTTP 404 (discovery not configured) is Error::Invalid("overlay disabled").

Source§

impl Client

Source

pub fn new(address: SocketAddr, token: String) -> Result<Self, Error>

Source

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.

Source

pub fn status_json(&self) -> Result<Value, Error>

Raw status JSON reported by the local operator, without verifying its claims.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more