pub struct DiscoveryClient { /* private fields */ }Expand description
Auto-generated client for the Discovery service.
Implementations§
Source§impl DiscoveryClient
impl DiscoveryClient
Sourcepub const SERVICE_NAME: &'static str = "discovery"
pub const SERVICE_NAME: &'static str = "discovery"
Canonical service/destination domain used for cryptographic RPC binding.
Sourcepub fn from_provider(
provider: &dyn RpcClientProvider,
signing_key: SigningKey,
token: Option<String>,
) -> Result<Self>
pub fn from_provider( provider: &dyn RpcClientProvider, signing_key: SigningKey, token: Option<String>, ) -> Result<Self>
Construct this typed client through an application-supplied
hyprstream_rpc::RpcClientProvider. Resolver authority and
endpoint policy stay outside the portable contract crate.
pub fn with_delegated_bearer(self, token: impl Into<String>) -> Self
Sourcepub fn with_bearer(self, token: impl Into<String>) -> Self
pub fn with_bearer(self, token: impl Into<String>) -> Self
Set this client’s DIRECT bearer for every call.
Unlike Self::with_delegated_bearer, the token travels as the
envelope’s own JWT — the caller is asserting the token as ITS
verified credential, and the receiving service’s holder/cnf
binding applies against this client’s signing key. Used for
caller-authored credentials (e.g. the Model→Inference
iw+jwt internal work order); never for relaying a foreign
holder’s token.
Sourcepub fn request(&self) -> RequestBuilder<'_>
pub fn request(&self) -> RequestBuilder<'_>
Create a per-call request builder for custom authentication options.
The builder is Send+Sync and idempotent — it stores per-call auth context without mutating the shared client. Safe for use with connection pooling.
Sourcepub async fn call(&self, payload: Vec<u8>) -> Result<Vec<u8>>
pub async fn call(&self, payload: Vec<u8>) -> Result<Vec<u8>>
Send a raw request and return the raw response bytes.
Sourcepub async fn call_with_method(
&self,
method_discriminator: u16,
payload: Vec<u8>,
) -> Result<Vec<u8>>
pub async fn call_with_method( &self, method_discriminator: u16, payload: Vec<u8>, ) -> Result<Vec<u8>>
Send a generated request with its canonical schema method id.
Sourcepub async fn call_streaming(
&self,
payload: Vec<u8>,
ephemeral_pubkey: [u8; 32],
) -> Result<Vec<u8>>
pub async fn call_streaming( &self, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Result<Vec<u8>>
Send a streaming request with ephemeral DH pubkey.
Sourcepub async fn call_streaming_with_method(
&self,
method_discriminator: u16,
payload: Vec<u8>,
ephemeral_pubkey: [u8; 32],
) -> Result<Vec<u8>>
pub async fn call_streaming_with_method( &self, method_discriminator: u16, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Result<Vec<u8>>
Send a generated streaming request with its schema method id.
Sourcepub async fn list_services(&self) -> Result<ServiceList>
pub async fn list_services(&self) -> Result<ServiceList>
List all registered services with descriptions
Scope: query
Sourcepub async fn get_endpoints(&self, value: &str) -> Result<ServiceEndpoints>
pub async fn get_endpoints(&self, value: &str) -> Result<ServiceEndpoints>
Get all endpoints for a named service
Scope: query
Sourcepub async fn get_schema(&self, value: &str) -> Result<Vec<u8>>
pub async fn get_schema(&self, value: &str) -> Result<Vec<u8>>
Get schema bytes for a service
Scope: query
Sourcepub async fn get_auth_metadata(&self, value: &str) -> Result<AuthMetadataList>
pub async fn get_auth_metadata(&self, value: &str) -> Result<AuthMetadataList>
Get OAuth protected resource metadata for services
Scope: query
Sourcepub async fn prepare_stream(&self) -> Result<()>
pub async fn prepare_stream(&self) -> Result<()>
prepare_stream (Void variant)
Sourcepub async fn get_stream(&self) -> Result<()>
pub async fn get_stream(&self) -> Result<()>
get_stream (Void variant)
Sourcepub async fn list_streams(&self) -> Result<()>
pub async fn list_streams(&self) -> Result<()>
list_streams (Void variant)
Sourcepub async fn announce(&self, __request: &ServiceAnnouncement) -> Result<()>
pub async fn announce(&self, __request: &ServiceAnnouncement) -> Result<()>
Announce a service endpoint for discovery
Scope: write
Sourcepub async fn register_entity_statement(
&self,
__request: &RegisterEntityStatementRequest,
) -> Result<()>
pub async fn register_entity_statement( &self, __request: &RegisterEntityStatementRequest, ) -> Result<()>
Register a signed OIDF entity statement for an issuer
Scope: write
Sourcepub async fn get_entity_statement(&self, value: &str) -> Result<EntityStatement>
pub async fn get_entity_statement(&self, value: &str) -> Result<EntityStatement>
Fetch cached signed entity statement for issuer URL
Scope: query
Sourcepub async fn register_envelope_keyset(
&self,
__request: &RegisterEnvelopeKeysetRequest,
) -> Result<()>
pub async fn register_envelope_keyset( &self, __request: &RegisterEnvelopeKeysetRequest, ) -> Result<()>
Register envelope COSE_KeySet for a service
Scope: write
Sourcepub async fn get_envelope_keyset(&self, value: &str) -> Result<EnvelopeKeyset>
pub async fn get_envelope_keyset(&self, value: &str) -> Result<EnvelopeKeyset>
Fetch cached envelope COSE_KeySet for service DID
Scope: query
Sourcepub async fn list_known_issuers(&self) -> Result<IssuerList>
pub async fn list_known_issuers(&self) -> Result<IssuerList>
List issuers with cached entity statements
Scope: query
Sourcepub async fn get_record(
&self,
__request: &GetRecordRequest,
) -> Result<RecordCar>
pub async fn get_record( &self, __request: &GetRecordRequest, ) -> Result<RecordCar>
Fetch an atproto record (ai.hyprstream.model) as a verifiable CAR proof
Scope: query
Sourcepub async fn get_repo(&self, value: &str) -> Result<RecordCar>
pub async fn get_repo(&self, value: &str) -> Result<RecordCar>
Fetch a full atproto repo CAR by DID
Scope: query
Sourcepub async fn query_candidates(
&self,
__request: &QueryCandidatesRequest,
) -> Result<PlacementCandidateSet>
pub async fn query_candidates( &self, __request: &QueryCandidatesRequest, ) -> Result<PlacementCandidateSet>
Query placement candidates by label-selector + resource requests
Scope: query
Sourcepub async fn report_node_liveness(&self, __request: &NodeLiveness) -> Result<()>
pub async fn report_node_liveness(&self, __request: &NodeLiveness) -> Result<()>
Report live node capacity/load for placement candidate liveness
Scope: write
Sourcepub fn parse_response(bytes: &[u8]) -> Result<DiscoveryResponseVariant>
pub fn parse_response(bytes: &[u8]) -> Result<DiscoveryResponseVariant>
Parse a response from raw bytes.
Source§impl DiscoveryClient
impl DiscoveryClient
Sourcepub fn for_local_bootstrap(
signing_key: SigningKey,
destination: VerifyingKey,
token: Option<String>,
) -> Result<Self>
pub fn for_local_bootstrap( signing_key: SigningKey, destination: VerifyingKey, token: Option<String>, ) -> Result<Self>
Construct a client for a co-located service discovered through the explicitly registered local endpoint.
Sourcepub fn for_local_endpoint_bootstrap(
endpoint: &str,
signing_key: SigningKey,
destination: VerifyingKey,
token: Option<String>,
) -> Result<Self>
pub fn for_local_endpoint_bootstrap( endpoint: &str, signing_key: SigningKey, destination: VerifyingKey, token: Option<String>, ) -> Result<Self>
Construct a client from an explicit local endpoint string.
Sourcepub fn for_local_transport_bootstrap(
transport: &TransportConfig,
signing_key: SigningKey,
destination: VerifyingKey,
token: Option<String>,
) -> Result<Self>
pub fn for_local_transport_bootstrap( transport: &TransportConfig, signing_key: SigningKey, destination: VerifyingKey, token: Option<String>, ) -> Result<Self>
Construct a client from a typed local transport.
Source§impl DiscoveryClient
impl DiscoveryClient
Sourcepub async fn call_method(&self, method: &str, args: &Value) -> Result<Value>
pub async fn call_method(&self, method: &str, args: &Value) -> Result<Value>
Dispatch a method call by name with JSON arguments. Returns the response as a proper JSON value.
Sourcepub async fn call_streaming_method(
&self,
method: &str,
args: &Value,
ephemeral_pubkey: [u8; 32],
) -> Result<StreamInfo>
pub async fn call_streaming_method( &self, method: &str, args: &Value, ephemeral_pubkey: [u8; 32], ) -> Result<StreamInfo>
Dispatch a streaming method call by name with JSON arguments and an ephemeral public key.
Returns the verified-capnp StreamInfo library type (decoded + COSE-verified
inside call_streaming) — NOT a re-serialized serde_json::Value (#468).
Trait Implementations§
Source§impl Clone for DiscoveryClient
impl Clone for DiscoveryClient
Source§fn clone(&self) -> DiscoveryClient
fn clone(&self) -> DiscoveryClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DiscoveryRpc for DiscoveryClient
impl DiscoveryRpc for DiscoveryClient
fn list_services<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServiceList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_endpoints<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ServiceEndpoints>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ping<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PingInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_auth_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AuthMetadataList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare_stream<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stream<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_streams<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn announce<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ServiceAnnouncement,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register_entity_statement<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 RegisterEntityStatementRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_entity_statement<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<EntityStatement>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register_envelope_keyset<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 RegisterEnvelopeKeysetRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_envelope_keyset<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<EnvelopeKeyset>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_known_issuers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IssuerList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_record<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 GetRecordRequest,
) -> Pin<Box<dyn Future<Output = Result<RecordCar>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_repo<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<RecordCar>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_candidates<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 QueryCandidatesRequest,
) -> Pin<Box<dyn Future<Output = Result<PlacementCandidateSet>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn report_node_liveness<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 NodeLiveness,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for DiscoveryClient
impl !RefUnwindSafe for DiscoveryClient
impl Send for DiscoveryClient
impl Sync for DiscoveryClient
impl Unpin for DiscoveryClient
impl UnsafeUnpin for DiscoveryClient
impl !UnwindSafe for DiscoveryClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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