pub trait DidDocumentResolver: Send + Sync {
// Required method
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Document>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn set_cache_ttls(&self, _positive_ttl: Duration, _negative_ttl: Duration) { ... }
fn cache_ttls(&self) -> Option<(Duration, Duration)> { ... }
}Expand description
Trait for resolving a DID to its DID document.
Ship with IpfsGatewayResolver for HTTP gateway resolution.
Implement this trait for custom resolution strategies.
Required Methods§
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Document>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
Sourcefn set_cache_ttls(&self, _positive_ttl: Duration, _negative_ttl: Duration)
fn set_cache_ttls(&self, _positive_ttl: Duration, _negative_ttl: Duration)
Update resolver cache TTLs at runtime.
Default implementation is a no-op for resolvers without mutable cache policy.
Sourcefn cache_ttls(&self) -> Option<(Duration, Duration)>
fn cache_ttls(&self) -> Option<(Duration, Duration)>
Return current resolver cache TTLs when supported.