pub struct TrqlClient { /* private fields */ }Expand description
Transport-agnostic Trust Registry query client.
Holds one TrqlTransport and the registry’s DID (the recipient stamped
on every request — the registry rejects documents addressed to anyone
else). Swapping HTTPS for DIDComm or TSP changes only the transport handed
to TrqlClient::new.
Implementations§
Source§impl TrqlClient
impl TrqlClient
Sourcepub fn new(
transport: Arc<dyn TrqlTransport>,
registry_did: impl Into<String>,
) -> Self
pub fn new( transport: Arc<dyn TrqlTransport>, registry_did: impl Into<String>, ) -> Self
A client that queries the registry identified by registry_did over
transport.
Sourcepub fn with_client_did(self, did: impl Into<String>) -> Self
pub fn with_client_did(self, did: impl Into<String>) -> Self
Set the in-band issuer on outbound documents. Optional over HTTPS
(the registry treats queries as anonymous reads); DIDComm and TSP
authenticate the sender at the transport layer regardless.
Ask whether entity is authorized by authority for action on
resource (registry/authorization/0.1).
A registry with no matching record answers authorized: false — absence
is a denial, not an error.
Sourcepub async fn recognition(
&self,
query: TrqpQuery,
) -> Result<RecognitionResponse, TrqlError>
pub async fn recognition( &self, query: TrqpQuery, ) -> Result<RecognitionResponse, TrqlError>
Ask whether entity is recognized by authority for action on
resource (registry/recognition/0.1).