pub struct CertFetcher { /* private fields */ }Expand description
Fetches certificates over NDN with deduplication and caching.
Implementations§
Source§impl CertFetcher
impl CertFetcher
Sourcepub fn new(
cert_cache: Arc<CertCache>,
fetch_fn: FetchFn,
timeout: Duration,
) -> Self
pub fn new( cert_cache: Arc<CertCache>, fetch_fn: FetchFn, timeout: Duration, ) -> Self
Create a new fetcher.
fetch_fn is called to express an Interest and return the Data response.
It is typically wired to an AppHandle in the engine.
Sourcepub async fn fetch(
&self,
cert_name: &Arc<Name>,
) -> Result<Certificate, TrustError>
pub async fn fetch( &self, cert_name: &Arc<Name>, ) -> Result<Certificate, TrustError>
Fetch a certificate by name.
Returns immediately if the cert is already cached. Otherwise, expresses an Interest, decodes the response, and caches it. Concurrent requests for the same name are deduplicated (only one Interest is sent).
Auto Trait Implementations§
impl Freeze for CertFetcher
impl !RefUnwindSafe for CertFetcher
impl Send for CertFetcher
impl Sync for CertFetcher
impl Unpin for CertFetcher
impl !UnwindSafe for CertFetcher
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