pub struct NdnDidResolver { /* private fields */ }Expand description
Resolves did:ndn DIDs by sending NDN Interests.
Configure via the builder methods:
with_fetcher— for CA-anchored DIDs (cert fetch)with_did_doc_fetcher— for zone DIDs (raw DID Document fetch)
Both can be configured on the same instance.
Implementations§
Source§impl NdnDidResolver
impl NdnDidResolver
Sourcepub fn with_fetcher(
self,
f: Arc<dyn Fn(Name) -> Pin<Box<dyn Future<Output = Option<Certificate>> + Send>> + Sync + Send>,
) -> NdnDidResolver
pub fn with_fetcher( self, f: Arc<dyn Fn(Name) -> Pin<Box<dyn Future<Output = Option<Certificate>> + Send>> + Sync + Send>, ) -> NdnDidResolver
Attach a certificate fetch function for CA-anchored did:ndn DIDs.
The function receives the identity name (e.g. /com/acme/alice) and
should return the certificate at <name>/KEY if found.
Sourcepub fn with_did_doc_fetcher(
self,
f: Arc<dyn Fn(Name) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send>> + Sync + Send>,
) -> NdnDidResolver
pub fn with_did_doc_fetcher( self, f: Arc<dyn Fn(Name) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send>> + Sync + Send>, ) -> NdnDidResolver
Attach a DID Document fetch function for zone did:ndn:v1:… DIDs.
The function receives the zone root name and should return the raw JSON-LD DID Document bytes from the Data packet at that name.
Trait Implementations§
Source§impl Clone for NdnDidResolver
impl Clone for NdnDidResolver
Source§fn clone(&self) -> NdnDidResolver
fn clone(&self) -> NdnDidResolver
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for NdnDidResolver
impl Default for NdnDidResolver
Source§fn default() -> NdnDidResolver
fn default() -> NdnDidResolver
Returns the “default value” for a type. Read more
Source§impl DidResolver for NdnDidResolver
impl DidResolver for NdnDidResolver
Auto Trait Implementations§
impl Freeze for NdnDidResolver
impl !RefUnwindSafe for NdnDidResolver
impl Send for NdnDidResolver
impl Sync for NdnDidResolver
impl Unpin for NdnDidResolver
impl !UnwindSafe for NdnDidResolver
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