pub struct HrefClient { /* private fields */ }Expand description
A DuckDB client bound to a specific stac-geoparquet href.
This wraps a Client with a specific href, implementing the
ArrowSearchClient trait. Because duckdb::Connection is not
Sync, use Mutex<HrefClient> for the async client
traits (SearchClient and CollectionSearchClient).
§Examples
use stac::api::ArrowSearchClient;
use stac_duckdb::HrefClient;
let client = HrefClient::new("data/100-sentinel-2-items.parquet").unwrap();
let record_batch_reader = client.search_to_arrow(Default::default()).unwrap();Implementations§
Source§impl HrefClient
impl HrefClient
Sourcepub fn new(href: impl ToString) -> Result<HrefClient>
pub fn new(href: impl ToString) -> Result<HrefClient>
Creates a new HrefClient for the given href.
Sourcepub fn from_client(client: Client, href: impl ToString) -> HrefClient
pub fn from_client(client: Client, href: impl ToString) -> HrefClient
Creates a new HrefClient from an existing Client and href.
Sourcepub fn client_mut(&mut self) -> &mut Client
pub fn client_mut(&mut self) -> &mut Client
Returns a mutable reference to the underlying Client.
Trait Implementations§
Source§impl ArrowSearchClient for HrefClient
impl ArrowSearchClient for HrefClient
Source§type RecordBatchStream<'a> = ArrowBatchReader<'a>
type RecordBatchStream<'a> = ArrowBatchReader<'a>
The record batch reader type returned by
ArrowSearchClient::search_to_arrow.Source§fn search_to_arrow(&self, search: Search) -> Result<ArrowBatchReader<'_>, Error>
fn search_to_arrow(&self, search: Search) -> Result<ArrowBatchReader<'_>, Error>
Searches for STAC items, returning results as Arrow record batches.
Auto Trait Implementations§
impl !Freeze for HrefClient
impl !RefUnwindSafe for HrefClient
impl Send for HrefClient
impl !Sync for HrefClient
impl Unpin for HrefClient
impl UnsafeUnpin for HrefClient
impl !UnwindSafe for HrefClient
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> 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