Crate pgstac

source ·
Expand description

Rust interface for pgstac

Examples

Client provides an interface to query a pgstac database. It can be created from anything that implements tokio_postgres::GenericClient.

use pgstac::Client;
use tokio_postgres::NoTls;

let config = "postgresql://username:password@localhost:5432/postgis";
let (client, connection) = tokio_postgres::connect(config, NoTls).await.unwrap();
let client = Client::new(client);

If you want to work in a transaction, you can do that too:

use stac::Collection;
let (mut client, connection) = tokio_postgres::connect(config, NoTls).await.unwrap();
let client = Client::new(client.transaction().await.unwrap());
client.add_collection(Collection::new("an-id", "a description")).await.unwrap();
client.into_inner().commit();

Structs

A pgstac client.
The page context.
Fields to include or exclude.
A page of search results.
Search.
Sort by.

Enums

Crate-specific error enum.

Type Definitions

Crate-specific result type.