pub struct ServiceCapabilities {
pub tsp: Option<String>,
pub didcomm: Option<String>,
pub https: Option<String>,
}Expand description
The transports a registry advertises, parsed from its DID document by
service type.
Each field holds the endpoint to route to for that protocol:
tsp/didcomm— the registry’s mediator DID, not a transport URL. Both use mediator indirection; the URL lives in the mediator’s own DID document, so a second resolution hop is required.https— the registry’s REST base URL, used directly.
Fields§
§tsp: Option<String>Mediator DID advertised for TSP, if any.
didcomm: Option<String>Mediator DID advertised for DIDComm, if any.
https: Option<String>REST base URL advertised, if any.
Implementations§
Source§impl ServiceCapabilities
impl ServiceCapabilities
Sourcepub fn from_document(doc: &Value) -> Self
pub fn from_document(doc: &Value) -> Self
Parse the service array of a resolved DID document.
Unknown service types are ignored, entries missing a usable endpoint are skipped, and the first entry of each type wins — a document advertising two DIDComm services is not an error, it just has one preferred.
Sourcepub fn endpoint(&self, kind: TransportKind) -> Option<&str>
pub fn endpoint(&self, kind: TransportKind) -> Option<&str>
The endpoint advertised for kind, if any.
Sourcepub fn advertised(&self) -> Vec<TransportKind>
pub fn advertised(&self) -> Vec<TransportKind>
Every transport advertised, in preference order.
Sourcepub fn select(
&self,
ours: &[TransportKind],
) -> Result<TransportChoice, TrqlError>
pub fn select( &self, ours: &[TransportKind], ) -> Result<TransportChoice, TrqlError>
Choose the transport to use: the highest-preference one present in both
ours and this capability set.
Returns TrqlError::NoMatchingTransport carrying both sides’ sets
when the intersection is empty, so an operator can see what each side
offers rather than guessing why a query failed.
Trait Implementations§
Source§impl Clone for ServiceCapabilities
impl Clone for ServiceCapabilities
Source§fn clone(&self) -> ServiceCapabilities
fn clone(&self) -> ServiceCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServiceCapabilities
impl Debug for ServiceCapabilities
Source§impl Default for ServiceCapabilities
impl Default for ServiceCapabilities
Source§fn default() -> ServiceCapabilities
fn default() -> ServiceCapabilities
impl Eq for ServiceCapabilities
Source§impl PartialEq for ServiceCapabilities
impl PartialEq for ServiceCapabilities
impl StructuralPartialEq for ServiceCapabilities
Auto Trait Implementations§
impl Freeze for ServiceCapabilities
impl RefUnwindSafe for ServiceCapabilities
impl Send for ServiceCapabilities
impl Sync for ServiceCapabilities
impl Unpin for ServiceCapabilities
impl UnsafeUnpin for ServiceCapabilities
impl UnwindSafe for ServiceCapabilities
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.