pub struct AsyncTesseraClient { /* private fields */ }Expand description
An async client for the Tessera API.
Mirror of crate::TesseraClient with async fn; use it inside tokio
runtimes (including when the sync client would panic).
Implementations§
Source§impl AsyncTesseraClient
impl AsyncTesseraClient
Sourcepub fn new(api_key: Option<&str>) -> Result<Self, TesseraError>
pub fn new(api_key: Option<&str>) -> Result<Self, TesseraError>
Create a client with defaults, resolving the key from api_key or
$TESSERA_API_KEY.
§Errors
Returns TesseraError::Configuration when no API key can be resolved.
Sourcepub fn from_config(config: ClientConfig) -> Result<Self, TesseraError>
pub fn from_config(config: ClientConfig) -> Result<Self, TesseraError>
Create a client from a fully-specified ClientConfig.
§Errors
Returns TesseraError::Network when the HTTP client cannot be built.
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
The resolved configuration this client was built with.
Sourcepub fn close(&mut self)
pub fn close(&mut self)
Close the client.
reqwest::Client tears its pool down on drop; taking the client out
eagerly releases the handle for parity with the Python aclose().
Sourcepub async fn datasets(&self) -> Result<DatasetsResponse, TesseraError>
pub async fn datasets(&self) -> Result<DatasetsResponse, TesseraError>
List every dataset visible to your plan.
§Errors
Returns any TesseraError the API or transport raises.
Sourcepub async fn partitions(
&self,
asset: &str,
coin: Option<&str>,
month: Option<&str>,
) -> Result<PartitionsResponse, TesseraError>
pub async fn partitions( &self, asset: &str, coin: Option<&str>, month: Option<&str>, ) -> Result<PartitionsResponse, TesseraError>
List the partitions of asset, optionally filtered by coin/month.
§Errors
Returns any TesseraError the API or transport raises.
Sourcepub async fn download_url(
&self,
asset: &str,
coin: &str,
month: &str,
) -> Result<DownloadResponse, TesseraError>
pub async fn download_url( &self, asset: &str, coin: &str, month: &str, ) -> Result<DownloadResponse, TesseraError>
Mint a short-lived presigned download URL for one partition.
§Errors
Returns any TesseraError the API or transport raises.
Sourcepub fn partition_refs(
&self,
asset: &str,
coin: impl IntoCoins,
month: impl IntoMonths,
) -> Result<Vec<PartitionRef>, TesseraError>
pub fn partition_refs( &self, asset: &str, coin: impl IntoCoins, month: impl IntoMonths, ) -> Result<Vec<PartitionRef>, TesseraError>
Expand (asset, coins, months) into concrete partition references.
§Errors
Returns TesseraError::InvalidArgument on empty/invalid arguments.
Sourcepub async fn scan(
&self,
asset: &str,
coin: impl IntoCoins,
month: impl IntoMonths,
columns: Option<&[&str]>,
) -> Result<LazyFrame, TesseraError>
pub async fn scan( &self, asset: &str, coin: impl IntoCoins, month: impl IntoMonths, columns: Option<&[&str]>, ) -> Result<LazyFrame, TesseraError>
Lazily scan one or more partitions into a Polars LazyFrame.
§Errors
Returns any TesseraError the API or transport raises.
Sourcepub async fn read(
&self,
asset: &str,
coin: impl IntoCoins,
month: impl IntoMonths,
columns: Option<&[&str]>,
) -> Result<DataFrame, TesseraError>
pub async fn read( &self, asset: &str, coin: impl IntoCoins, month: impl IntoMonths, columns: Option<&[&str]>, ) -> Result<DataFrame, TesseraError>
Eagerly read one or more partitions into a Polars DataFrame.
§Errors
Returns any TesseraError the API or transport raises, including
TesseraError::PresignExpired for rejected presigned URLs.
Sourcepub async fn to_duckdb(
&self,
asset: &str,
coin: impl IntoCoins,
month: impl IntoMonths,
columns: Option<&[&str]>,
) -> Result<Connection, TesseraError>
pub async fn to_duckdb( &self, asset: &str, coin: impl IntoCoins, month: impl IntoMonths, columns: Option<&[&str]>, ) -> Result<Connection, TesseraError>
Open one or more partitions as an in-memory DuckDB connection exposing
a tessera view for SQL querying.
§Errors
Returns any TesseraError the API or transport raises.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncTesseraClient
impl !UnwindSafe for AsyncTesseraClient
impl Freeze for AsyncTesseraClient
impl Send for AsyncTesseraClient
impl Sync for AsyncTesseraClient
impl Unpin for AsyncTesseraClient
impl UnsafeUnpin for AsyncTesseraClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> ⓘ
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> ⓘ
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