Trait stac_async::AsyncRead
source · [−]pub trait AsyncRead {
fn read_json_from_path<'life0, 'async_trait, P>(
&'life0 self,
path: P
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where
P: AsRef<Path> + Send + Sync,
P: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait;
fn read_json_from_url<'life0, 'async_trait>(
&'life0 self,
url: Url
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn read<'life0, 'async_trait, H>(
&'life0 self,
href: H
) -> Pin<Box<dyn Future<Output = Result<HrefObject>> + Send + 'async_trait>>
where
H: Into<Href> + Send + Sync,
H: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
{ ... }
fn read_json<'life0, 'async_trait, H>(
&'life0 self,
href: H
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where
H: Into<Href> + Send + Sync,
H: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
{ ... }
}
Expand description
Reads STAC objects asynchronously.
Required Methods
Reads json data from a local filesystem path.
Provided Methods
Reads a HrefObject asynchronously.
Examples
AsyncReader implements AsyncRead:
use stac_async::{AsyncRead, AsyncReader};
let reader = AsyncReader::new();
let catalog = reader.read("data/catalog.json").await.unwrap();