pub struct EvidentSourceBuilder { /* private fields */ }Expand description
Builder for configuring and connecting to an EvidentSource server.
§Example
ⓘ
use evidentsource_client::{EvidentSource, Credentials, DevModeCredentials};
use std::time::Duration;
let es = EvidentSource::builder("http://localhost:50051")
.credentials(Credentials::DevMode(
DevModeCredentials::new("dev-user@example.com")
))
.connect_timeout(Duration::from_secs(10))
.tls(TlsConfig::Native)
.connect()
.await?;Implementations§
Source§impl EvidentSourceBuilder
impl EvidentSourceBuilder
Sourcepub fn credentials(self, credentials: Credentials) -> Self
pub fn credentials(self, credentials: Credentials) -> Self
Sourcepub fn tls(self, config: TlsConfig) -> Self
pub fn tls(self, config: TlsConfig) -> Self
Set the TLS configuration.
For HTTPS addresses, TLS is enabled by default with native roots.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set the connection timeout.
Sourcepub fn backoff(self, config: BackoffConfig) -> Self
pub fn backoff(self, config: BackoffConfig) -> Self
Set the backoff configuration for retries.
Sourcepub async fn connect(self) -> Result<EvidentSource, Error>
pub async fn connect(self) -> Result<EvidentSource, Error>
Connect to the server with the configured options.
Sourcepub fn get_backoff(&self) -> Option<&BackoffConfig>
pub fn get_backoff(&self) -> Option<&BackoffConfig>
Get the configured backoff settings.
This can be used when creating connections to propagate retry settings.
Trait Implementations§
Source§impl Clone for EvidentSourceBuilder
impl Clone for EvidentSourceBuilder
Source§fn clone(&self) -> EvidentSourceBuilder
fn clone(&self) -> EvidentSourceBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EvidentSourceBuilder
impl RefUnwindSafe for EvidentSourceBuilder
impl Send for EvidentSourceBuilder
impl Sync for EvidentSourceBuilder
impl Unpin for EvidentSourceBuilder
impl UnwindSafe for EvidentSourceBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request