Skip to main content

AsyncRetrieve

Trait AsyncRetrieve 

Source
pub trait AsyncRetrieve: RetrieverBounds {
    // Required method
    fn retrieve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uri: &'life1 Uri<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}

Required Methods§

Source

fn retrieve<'life0, 'life1, 'async_trait>( &'life0 self, uri: &'life1 Uri<String>, ) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Asynchronously retrieve a resource from the given URI.

This is the non-blocking equivalent of Retrieve::retrieve.

§Arguments
  • uri - The URI of the resource to retrieve.
§Errors

This method can fail for various reasons:

  • Resource not found
  • Network errors (for remote resources)
  • Permission errors

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§