pub struct Builder { /* private fields */ }
Expand description
Builds a new Client
with custom settings.
Implementations§
source§impl Builder
impl Builder
sourcepub fn with_runtime(self, handle: Handle) -> Builder
pub fn with_runtime(self, handle: Handle) -> Builder
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>(self) -> Builderwhere
Api: Api,
pub fn with_api<Api>(self) -> Builderwhere
Api: Api,
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>(self, callback: ApiCallback<Api>) -> Builderwhere
Api: Api,
pub fn with_api_callback<Api>(self, callback: ApiCallback<Api>) -> Builderwhere
Api: Api,
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) -> Builder
pub fn with_certificate(self, certificate: Certificate) -> Builder
Connects to a server using a pinned certificate
. Only supported with BonsaiDb protocol-based connections.
sourcepub fn with_protocol_version(self, version: &'static str) -> Builder
pub fn with_protocol_version(self, version: &'static str) -> Builder
Overrides the protocol version. Only for testing purposes.