pub async fn retrieve_entry(
        &mut self,
        hash: EntryHash,
        mut options: NetworkGetOptions,
    ) -> CascadeResult<Option<EntryHashed>> {
        let result = self.find_map(|store| Ok(store.get_entry(&hash)?))?;
        if result.is_some() {
            return Ok(result.map(EntryHashed::from_content_sync));
        }
        options.request_type = aingle_p2p::event::GetRequest::Pending;
        self.fetch_element(hash.clone().into(), options).await?;

        // Check if we have the data now after the network call.
        let result = self.find_map(|store| Ok(store.get_entry(&hash)?))?;
        Ok(result.map(EntryHashed::from_content_sync))
    }
/// Retrieve [`Entry`] from either locally or from an authority.
/// Data might not have been validated yet by the authority.
Retrieve [`Entry`] from either locally or from an authority.
Data might not have been validated yet by the authority.
Retrieve [ ` Entry ` ] from either locally or from an authority . Data might not have been validated yet by the authority .
pub async fn retrieve_entry(
        &mut self,
        hash: EntryHash,
        mut options: NetworkGetOptions,
    ) -> CascadeResult<Option<EntryHashed>> {
        let result = self.find_map(|store| Ok(store.get_entry(&hash)?))?;
        if result.is_some() {
            return Ok(result.map(EntryHashed::from_content_sync));
        }
        options.request_type = aingle_p2p::event::GetRequest::Pending;
        self.fetch_element(hash.clone().into(), options).await?;
        // Check if we have the data now after the network call.
        let result = self.find_map(|store| Ok(store.get_entry(&hash)?))?;
        Ok(result.map(EntryHashed::from_content_sync))
    }
pub async fn retrieve_entry ( & mut self , hash : EntryHash , mut options : NetworkGetOptions , ) -> CascadeResult < Option < EntryHashed > > { let result = self . find_map ( | store | Ok ( store . get_entry ( & hash ) ? ) ) ? ; if result . is_some ( ) { return Ok ( result . map ( EntryHashed :: from_content_sync ) ) ; } options . request_type = aingle_p2p :: event :: GetRequest :: Pending ; self . fetch_element ( hash . clone ( ) . into ( ) , options ) . await ? ; // Check if we have the data now after the network call. let result = self . find_map ( | store | Ok ( store . get_entry ( & hash ) ? ) ) ? ; Ok ( result . map ( EntryHashed :: from_content_sync ) ) }
Retrieve [`Entry`] from either locally or from an authority.
Retrieve [ ` Entry ` ] from either locally or from an authority .
&mut self
hash
EntryHash
options
NetworkGetOptions
&mut self
hash
EntryHash
options
NetworkGetOptions