pub struct ClientBuilder { /* private fields */ }Expand description
Builder for a Client.
Start with ClientBuilder::new, chain the setters you need, then call
build.
let client = ClientBuilder::new("user", "trino.example.com")
.port(8443)
.secure(true)
.catalog("hive")
.schema("default")
.build()?;Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(user: impl ToString, host: impl ToString) -> Self
pub fn new(user: impl ToString, host: impl ToString) -> Self
Start building a client for the given Trino user and host.
Defaults: port 8080, plain HTTP, no authentication. Use the setters to
change them, then call build.
pub fn port(self, s: u16) -> Self
pub fn secure(self, s: bool) -> Self
pub fn no_verify(self, nv: bool) -> Self
pub fn source(self, s: impl ToString) -> Self
pub fn trace_token(self, s: impl ToString) -> Self
pub fn client_tag(self, s: impl ToString) -> Self
pub fn client_info(self, s: impl ToString) -> Self
pub fn catalog(self, s: impl ToString) -> Self
pub fn schema(self, s: impl ToString) -> Self
pub fn path(self, s: impl ToString) -> Self
pub fn resource_estimates(self, s: HashMap<String, String>) -> Self
pub fn resource_estimate(self, k: impl ToString, v: impl ToString) -> Self
pub fn properties(self, s: HashMap<String, String>) -> Self
pub fn property(self, k: impl ToString, v: impl ToString) -> Self
pub fn prepared_statements(self, s: HashMap<String, String>) -> Self
pub fn prepared_statement(self, k: impl ToString, v: impl ToString) -> Self
pub fn extra_credentials(self, s: HashMap<String, String>) -> Self
pub fn extra_credential(self, k: impl ToString, v: impl ToString) -> Self
pub fn transaction_id(self, s: TransactionId) -> Self
pub fn client_request_timeout(self, s: Duration) -> Self
pub fn compression_disabled(self, s: bool) -> Self
pub fn segment_fetcher(self, segment_fetcher: SegmentFetcher) -> Self
Sourcepub fn max_concurrent_segments(self, count: usize) -> Self
pub fn max_concurrent_segments(self, count: usize) -> Self
Set the maximum number of concurrent segment fetches Default is based on available CPU parallelism (minimum 1)
Sourcepub fn spooling_encoding(self, encoding: impl ToString) -> Self
pub fn spooling_encoding(self, encoding: impl ToString) -> Self
Set the spooling encoding format. Supported values: “json”, “json+zstd”, “json+lz4”. Defaults to “json+zstd” if not specified.
pub fn auth(self, s: Auth) -> Self
pub fn auth_http_insecure(self, ahi: bool) -> Self
pub fn max_attempt(self, s: usize) -> Self
Sourcepub fn retry_policy(self, policy: RetryPolicy) -> Self
pub fn retry_policy(self, policy: RetryPolicy) -> Self
Set the full retry/backoff policy for transient failures.
pub fn ssl(self, ssl: Ssl) -> Self
pub fn build(self) -> Result<Client>
Auto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Freeze for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
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