pub struct Builder<AsyncMode> { /* private fields */ }Expand description
Builder for a BlockingClient or an AsyncClient.
Implementations§
Source§impl<AsyncMode> Builder<AsyncMode>
impl<AsyncMode> Builder<AsyncMode>
Sourcepub fn with_runtime(self, handle: Handle) -> Self
pub fn with_runtime(self, handle: Handle) -> Self
Specifies the tokio runtime this client should use for its async tasks.
If not specified, Client will try to acquire a handle via
tokio::runtime::Handle::try_current().
Sourcepub fn with_api<Api: Api>(self) -> Self
pub fn with_api<Api: Api>(self) -> Self
Enables using a Api with this client. If you want to
receive out-of-band API requests, set a callback using
with_custom_api_callback instead.
Sourcepub fn with_api_callback<Api: Api>(self, callback: ApiCallback<Api>) -> Self
pub fn with_api_callback<Api: Api>(self, callback: ApiCallback<Api>) -> Self
Enables using a Api with this client. callback will be
invoked when custom API responses are received from the server.
Sourcepub fn with_certificate(self, certificate: Certificate) -> Self
pub fn with_certificate(self, certificate: Certificate) -> Self
Connects to a server using a pinned certificate. Only supported with BonsaiDb protocol-based connections.
Sourcepub fn with_request_timeout(self, timeout: impl Into<Duration>) -> Self
pub fn with_request_timeout(self, timeout: impl Into<Duration>) -> Self
Sets the request timeout for the client.
If not specified, requests will time out after 60 seconds.
Sourcepub fn with_connect_timeout(self, timeout: impl Into<Duration>) -> Self
pub fn with_connect_timeout(self, timeout: impl Into<Duration>) -> Self
Sets the connection timeout for the client.
If not specified, the client will time out after 60 seconds if a connection cannot be established.
Auto Trait Implementations§
impl<AsyncMode> Freeze for Builder<AsyncMode>
impl<AsyncMode> !RefUnwindSafe for Builder<AsyncMode>
impl<AsyncMode> Send for Builder<AsyncMode>where
AsyncMode: Send,
impl<AsyncMode> Sync for Builder<AsyncMode>where
AsyncMode: Sync,
impl<AsyncMode> Unpin for Builder<AsyncMode>where
AsyncMode: Unpin,
impl<AsyncMode> !UnwindSafe for Builder<AsyncMode>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>
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