pub struct Client { /* private fields */ }
Expand description
Client to access OGC APIs and/or SpatioTemporal Asset Catalogs (STAC).
§Example:
use ogcapi_client::Client;
let endpoint = "https://data.geo.admin.ch/api/stac/v0.9/";
let client = Client::new(endpoint).unwrap();
client.collections().unwrap().for_each(|c| match c {
Ok(c) => {
println!("{} ({})", c.id, c.title.unwrap_or("".to_string()))
}
Err(e) => {
eprintln!("{}", e)
}
});
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(endpoint: &str) -> Result<Self, Error>
pub fn new(endpoint: &str) -> Result<Self, Error>
Creates a Client for a given OGCAPI
/STAC
endpoint.
Sourcepub fn root(&self) -> Result<LandingPage, Error>
pub fn root(&self) -> Result<LandingPage, Error>
Returns the landing page or the root catalog.
Sourcepub fn conformance(&self) -> Result<Conformance, Error>
pub fn conformance(&self) -> Result<Conformance, Error>
Returns the conformance declaration of the SpatioTemporal Asset Catalog.
Sourcepub fn collections(&self) -> Result<Collections, Error>
pub fn collections(&self) -> Result<Collections, Error>
Returns an iterator over the collections.
pub fn collection(&self, id: &str) -> Result<Collection, Error>
pub fn items(&self, id: &str) -> Result<Items, Error>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more