Skip to main content

Module remote

Module remote 

Source
Expand description

The rustev.remote/1 protocol documents (spec 009, 3.10) and the vendor-neutral exchange record rustev.remote-exchange/1 (3.9.1).

Serde types only: no transport, no async runtime, and no vendor, model or provider name (spec 009, I-7). Every document denies unknown fields, carries an exact schema string and parses under a declared limit set through the bounded parser (crate::Document::parse). On the wire a document is its record canonical bytes (spec 004, 5.6), which equal its canonical bytes whenever it holds no fractional number.

Nothing a remote party returns is authorization (spec 009, 3.1): an infer answer is a RawOutput or a classified failure, and everything else it carries is retained in the exchange record, which no policy reads.

Structs§

CancelItem
CancelRequest
CancelResponse
ConnectionObservation
The connection an exchange used (spec 020, 3.5): fresh or reused, a nonsecret instance id, its age bucket and use count, the multiplex posture, the isolation-key digest, and why it left the pool after this exchange, if it did.
DescribeRequest
The protocol major versions the client supports (spec 009, 3.10.1).
DescribeResponse
The chosen version and, per hosted backend, its descriptor, descriptor identity and terms.
ExchangeMember
ExchangeRecord
One exchange, keyed by the attempt ids it served (spec 009, 3.9.1). Bounded: every string is cut to MAX_TEXT_BYTES and every collection to its cap by ExchangeRecord::bounded, so a record never exceeds EXCHANGE_V1’s max_bytes. Request and response bytes are never in the record; only their digests are.
HostedBackend
InferItem
InferRequest
InferResponse
ItemAnswer
PhaseExpiry
The phase that ran out (spec 020, 3.4): its configured ceiling, the effective allowance it started with (the lesser of the ceiling and the remaining attempt budget), the time observed in it, whether request bytes had left, and the existing code the expiry mapped to.
PrincipalEvidence
A principal reference as evidence holds it (spec 020, 3.2 and 3.6): its domain-separated digest and mapping version, never the reference.
RemoteTerms
Terms negotiated beside the descriptor (spec 009, 3.2.4). The runtime never reads them; the adapter enforces and records them.
ReportedCost
ServedIdentity
A served identity as recorded (spec 009, 3.7).
ServedTerms
Served-identity disclosure as negotiated. identity is the pinned identity, present exactly when disclosure is pinned.
WirePrincipal
An opaque principal reference on the wire (spec 020, 3.6): the host’s bytes as lowercase hexadecimal, the host’s mapping version, and the declared scope. Rustev never interprets, authenticates, authorizes or expands it.

Enums§

AgeBucket
A connection’s age when an exchange took it, bucketed so evidence holds no timing beyond what the bound needs.
Attribution
How an exchange’s charge reached its members (spec 009, 3.10.4).
Batching
Shared-state batching support (spec 009, 3.10.4).
CancelSupport
How far the remote side supports cancellation (spec 009, 3.2.4).
ConnectionReuse
Whether an exchange’s connection was opened for it or reused.
Disclosure
What a served identity is worth (spec 009, 3.7).
EvictionReason
Why a pooled connection left the pool (spec 020, 3.5).
ItemResult
MemberOutcome
Multiplex
How requests share a connection. HTTP/1.1, the only binding today, carries one request at a time.
PhaseLimit
What bounded a phase that ran out: its own ceiling, or the remaining attempt budget when that was smaller (spec 020, 3.4).
RemoteCancelAnswer
RemoteCode
The closed error taxonomy (spec 009, 3.6). Each code maps to exactly one spec 003 failure class; the mapping lives with the adapters, because the failure classes of the backend seam are not contract types.
TransportPhase
A transport phase with its own ceiling inside the one attempt budget (spec 020, 3.4), in the order an exchange passes through them.

Constants§

MAX_ENTRIES
The most entries of each map (usage, privacy options, provider extras) an exchange record keeps.
MAX_ITEMS
The most items one infer request may carry, whatever the terms say, and the most members an exchange record lists.
MAX_PRINCIPAL_BYTES
The most bytes of an opaque principal reference (spec 020, 3.6).
MAX_PRINCIPAL_LABEL_BYTES
The most bytes of a principal mapping version or scope.
MAX_ROUTE
The most route entries an exchange record keeps.
MAX_TEXT_BYTES
Free text in a failure detail or an exchange record is cut to this many bytes (spec 009, 3.9.1; spec 003, 3.9.3).
PRINCIPAL_DIGEST_TAG
The domain tag of a principal reference’s evidence digest.
PROTOCOL
The protocol’s name, as recorded in exchange records.
PROTOCOL_MAJOR
The protocol’s major version.
PROTOCOL_MAJOR_V2
rustev.remote/2 (spec 020, 2): version 1 plus the wire members spec 020 defines, today the host-endpoint principal reference of an infer request (3.6). The documents keep their schema strings and carry version: 2.
PROTOCOL_V2

Functions§

cut_text
s cut to at most MAX_TEXT_BYTES bytes, on a character boundary.
cut_to
s cut to at most max bytes, on a character boundary.
protocol_name
The protocol name of a major version this crate defines.