pub trait Pgstac: GenericClient {
Show 26 methods
// Provided methods
async fn pgstac_version(&self) -> Result<String> { ... }
async fn readonly(&self) -> Result<bool> { ... }
async fn context(&self) -> Result<bool> { ... }
async fn set_pgstac_setting(&self, key: &str, value: &str) -> Result<()> { ... }
async fn collections(&self) -> Result<Vec<JsonValue>> { ... }
async fn collection(&self, id: &str) -> Result<Option<JsonValue>> { ... }
async fn add_collection<T>(&self, collection: T) -> Result<()>
where T: Serialize { ... }
async fn upsert_collection<T>(&self, collection: T) -> Result<()>
where T: Serialize { ... }
async fn update_collection_extents(&self) -> Result<()> { ... }
async fn update_collection<T>(&self, collection: T) -> Result<()>
where T: Serialize { ... }
async fn delete_collection(&self, id: &str) -> Result<()> { ... }
async fn item(
&self,
id: &str,
collection: Option<&str>,
) -> Result<Option<JsonValue>> { ... }
async fn add_item<T>(&self, item: T) -> Result<()>
where T: Serialize { ... }
async fn add_items<T>(&self, items: &[T]) -> Result<()>
where T: Serialize { ... }
async fn update_item<T>(&self, item: T) -> Result<()>
where T: Serialize { ... }
async fn upsert_item<T>(&self, item: T) -> Result<()>
where T: Serialize { ... }
async fn upsert_items<T>(&self, items: &[T]) -> Result<()>
where T: Serialize { ... }
async fn delete_item(
&self,
id: &str,
collection: Option<&str>,
) -> Result<()> { ... }
async fn search(&self, search: Search) -> Result<Page> { ... }
async fn pgstac(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Row, Error> { ... }
async fn pgstac_string(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<String> { ... }
async fn pgstac_bool(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<bool> { ... }
async fn pgstac_vec<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Vec<T>>
where T: DeserializeOwned { ... }
async fn pgstac_opt<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Option<T>>
where T: DeserializeOwned { ... }
async fn pgstac_value<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<T>
where T: DeserializeOwned { ... }
async fn pgstac_void(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<()> { ... }
}Expand description
Methods for working with pgstac.
Provided Methods§
Sourceasync fn pgstac_version(&self) -> Result<String>
async fn pgstac_version(&self) -> Result<String>
Returns the pgstac version.
Sourceasync fn context(&self) -> Result<bool>
async fn context(&self) -> Result<bool>
Returns the value of the context pgstac setting.
This setting defaults to “off”. See the pgstac docs for more information on the settings and their meaning.
Sourceasync fn set_pgstac_setting(&self, key: &str, value: &str) -> Result<()>
async fn set_pgstac_setting(&self, key: &str, value: &str) -> Result<()>
Sets the value of a pgstac setting.
Sourceasync fn collections(&self) -> Result<Vec<JsonValue>>
async fn collections(&self) -> Result<Vec<JsonValue>>
Fetches all collections.
Sourceasync fn add_collection<T>(&self, collection: T) -> Result<()>where
T: Serialize,
async fn add_collection<T>(&self, collection: T) -> Result<()>where
T: Serialize,
Adds a collection.
Sourceasync fn upsert_collection<T>(&self, collection: T) -> Result<()>where
T: Serialize,
async fn upsert_collection<T>(&self, collection: T) -> Result<()>where
T: Serialize,
Adds or updates a collection.
Sourceasync fn update_collection_extents(&self) -> Result<()>
async fn update_collection_extents(&self) -> Result<()>
Updates all collection extents.
Sourceasync fn update_collection<T>(&self, collection: T) -> Result<()>where
T: Serialize,
async fn update_collection<T>(&self, collection: T) -> Result<()>where
T: Serialize,
Updates a collection.
Sourceasync fn delete_collection(&self, id: &str) -> Result<()>
async fn delete_collection(&self, id: &str) -> Result<()>
Deletes a collection.
Sourceasync fn item(
&self,
id: &str,
collection: Option<&str>,
) -> Result<Option<JsonValue>>
async fn item( &self, id: &str, collection: Option<&str>, ) -> Result<Option<JsonValue>>
Fetches an item.
Sourceasync fn update_item<T>(&self, item: T) -> Result<()>where
T: Serialize,
async fn update_item<T>(&self, item: T) -> Result<()>where
T: Serialize,
Updates an item.
Sourceasync fn upsert_item<T>(&self, item: T) -> Result<()>where
T: Serialize,
async fn upsert_item<T>(&self, item: T) -> Result<()>where
T: Serialize,
Upserts an item.
Sourceasync fn upsert_items<T>(&self, items: &[T]) -> Result<()>where
T: Serialize,
async fn upsert_items<T>(&self, items: &[T]) -> Result<()>where
T: Serialize,
Upserts items.
To avoid having to iterate the entire slice to serialize, these items must all be serde_json::Value.
Sourceasync fn pgstac(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Row, Error>
async fn pgstac( &self, function: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<Row, Error>
Runs a pgstac function.
Sourceasync fn pgstac_string(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<String>
async fn pgstac_string( &self, function: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<String>
Returns a string result from a pgstac function.
Sourceasync fn pgstac_bool(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<bool>
async fn pgstac_bool( &self, function: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<bool>
Returns a bool result from a pgstac function.
Sourceasync fn pgstac_vec<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Vec<T>>where
T: DeserializeOwned,
async fn pgstac_vec<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Vec<T>>where
T: DeserializeOwned,
Returns a vector from a pgstac function.
Sourceasync fn pgstac_opt<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Option<T>>where
T: DeserializeOwned,
async fn pgstac_opt<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Option<T>>where
T: DeserializeOwned,
Returns an optional value from a pgstac function.
Sourceasync fn pgstac_value<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<T>where
T: DeserializeOwned,
async fn pgstac_value<T>(
&self,
function: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<T>where
T: DeserializeOwned,
Returns a deserializable value from a pgstac function.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.