pub struct PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,{ /* private fields */ }
Expand description
A backend for a pgstac database.
Implementations§
Source§impl PgstacBackend<MakeRustlsConnect>
impl PgstacBackend<MakeRustlsConnect>
Sourcepub async fn new_from_stringlike(
params: impl ToString,
) -> Result<PgstacBackend<MakeRustlsConnect>>
pub async fn new_from_stringlike( params: impl ToString, ) -> Result<PgstacBackend<MakeRustlsConnect>>
Creates a new PgstacBackend from a string-like configuration.
This will use an unverified tls. To provide your own tls, use PgstacBackend::new_from_stringlike_and_tls.
§Examples
use stac_server::PgstacBackend;
let backend = PgstacBackend::new_from_stringlike("postgresql://username:password@localhost:5432/postgis").await.unwrap();
Source§impl<Tls> PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Sourcepub async fn new_from_stringlike_and_tls(
params: impl ToString,
tls: Tls,
) -> Result<PgstacBackend<Tls>>
pub async fn new_from_stringlike_and_tls( params: impl ToString, tls: Tls, ) -> Result<PgstacBackend<Tls>>
Creates a new PgstacBackend from a string-like configuration and a tls.
Trait Implementations§
Source§impl<Tls> Backend for PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> Backend for PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Source§fn has_item_search(&self) -> bool
fn has_item_search(&self) -> bool
Returns true if this backend has item search capabilities. Read more
Source§async fn add_collection(&mut self, collection: Collection) -> Result<()>
async fn add_collection(&mut self, collection: Collection) -> Result<()>
Adds a collection. Read more
Source§async fn collection(&self, id: &str) -> Result<Option<Collection>>
async fn collection(&self, id: &str) -> Result<Option<Collection>>
Returns a single collection. Read more
Source§async fn collections(&self) -> Result<Vec<Collection>>
async fn collections(&self) -> Result<Vec<Collection>>
Returns all collections. Read more
Source§async fn items(
&self,
collection_id: &str,
items: Items,
) -> Result<Option<ItemCollection>>
async fn items( &self, collection_id: &str, items: Items, ) -> Result<Option<ItemCollection>>
Retrieves items for a given collection. Read more
Source§impl<Tls> Clone for PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static + Clone,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> Clone for PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static + Clone,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Source§fn clone(&self) -> PgstacBackend<Tls>
fn clone(&self) -> PgstacBackend<Tls>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Tls> Debug for PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static + Debug,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
impl<Tls> Debug for PgstacBackend<Tls>where
Tls: MakeTlsConnect<Socket> + Clone + Send + Sync + 'static + Debug,
<Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
<Tls as MakeTlsConnect<Socket>>::TlsConnect: Send,
<<Tls as MakeTlsConnect<Socket>>::TlsConnect as TlsConnect<Socket>>::Future: Send,
Auto Trait Implementations§
impl<Tls> Freeze for PgstacBackend<Tls>
impl<Tls> !RefUnwindSafe for PgstacBackend<Tls>
impl<Tls> Send for PgstacBackend<Tls>
impl<Tls> Sync for PgstacBackend<Tls>
impl<Tls> Unpin for PgstacBackend<Tls>
impl<Tls> !UnwindSafe for PgstacBackend<Tls>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more