pub struct ServiceCapabilities {
pub tsp: Option<String>,
pub didcomm: Option<String>,
pub rest: Option<String>,
}Expand description
The transport services a party advertises in its DID document, parsed by
service type. Each field holds the endpoint the SDK would route to for
that protocol:
tsp/didcomm: the party’s mediator DID (its VID / mediator), not a transport URL — TSP and DIDComm both use mediator indirection (the transport URL lives in the mediator’s own DID document).rest: the party’s REST base URL.
Fields§
§tsp: Option<String>§didcomm: Option<String>§rest: Option<String>Implementations§
Source§impl ServiceCapabilities
impl ServiceCapabilities
Sourcepub fn from_did_document(doc: &Value) -> Self
pub fn from_did_document(doc: &Value) -> Self
Parse the advertised transports from a resolved DID document.
Walks the service array and selects entries by their type (D9 —
never by #id). The type may be a string or an array of strings
(DID-Core permits both). The first non-empty endpoint of each type
wins; later duplicates are ignored. A document with no service
array yields an all-None capability set.
Sourcepub fn endpoint(&self, protocol: Protocol) -> Option<&str>
pub fn endpoint(&self, protocol: Protocol) -> Option<&str>
The endpoint advertised for protocol, if any (mediator DID for
TSP/DIDComm, URL for REST).
Sourcepub fn advertised(&self) -> Vec<Protocol>
pub fn advertised(&self) -> Vec<Protocol>
Every protocol this party advertises, in preference order.
Trait Implementations§
Source§impl Clone for ServiceCapabilities
impl Clone for ServiceCapabilities
Source§fn clone(&self) -> ServiceCapabilities
fn clone(&self) -> ServiceCapabilities
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
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
Mutably borrows from an owned value. Read more