pub struct DanubeClientBuilder { /* private fields */ }Expand description
A builder for configuring and creating a DanubeClient instance.
The DanubeClientBuilder struct provides methods for setting various options needed to construct a DanubeClient. This includes configuring the base URI for the Danube service, connection settings.
§Fields
uri: The base URI for the Danube service. This is a required field and specifies the address of the service that the client will connect to. It is essential for constructing theDanubeClient.connection_options: Optional connection settings that define how the grpc client connects to the Danube service. These settings can include parameters such as timeouts, retries, and other connection-related configurations.
Implementations§
Source§impl DanubeClientBuilder
impl DanubeClientBuilder
Sourcepub fn service_url(self, url: impl Into<String>) -> Self
pub fn service_url(self, url: impl Into<String>) -> Self
Sets the base URI for the Danube service in the builder.
This method configures the base URI that the DanubeClient will use to connect to the Danube service. The base URI is a required parameter for establishing a connection and interacting with the service.
§Parameters
url: The base URI to use for connecting to the Danube service. The URI should include the protocol and address of the Danube service.
Sourcepub fn with_connection_options(
self,
connection_options: ConnectionOptions,
) -> Self
pub fn with_connection_options( self, connection_options: ConnectionOptions, ) -> Self
Sets optional connection settings for the client in the builder.
This method allows you to configure various connection settings for the DanubeClient through the builder. These settings determine how the client connects to the grpc Danube service and can be tailored to meet specific requirements.
§Parameters
connection_options: AConnectionOptionsinstance that includes various settings for configuring the client’s connection. This may include parameters such as connection timeouts, keep alive interval.
Sourcepub fn build(self) -> Result<DanubeClient>
pub fn build(self) -> Result<DanubeClient>
Constructs and returns a DanubeClient instance based on the configuration specified in the builder.
This method finalizes the configuration and creates a new DanubeClient instance. It uses the settings and options that were configured using the DanubeClientBuilder methods.
§Returns
Ok(DanubeClient): A new instance ofDanubeClientconfigured with the specified options.Err(e): An error if the configuration is invalid or incomplete.
Trait Implementations§
Source§impl Clone for DanubeClientBuilder
impl Clone for DanubeClientBuilder
Source§fn clone(&self) -> DanubeClientBuilder
fn clone(&self) -> DanubeClientBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DanubeClientBuilder
impl Debug for DanubeClientBuilder
Source§impl Default for DanubeClientBuilder
impl Default for DanubeClientBuilder
Source§fn default() -> DanubeClientBuilder
fn default() -> DanubeClientBuilder
Auto Trait Implementations§
impl Freeze for DanubeClientBuilder
impl RefUnwindSafe for DanubeClientBuilder
impl Send for DanubeClientBuilder
impl Sync for DanubeClientBuilder
impl Unpin for DanubeClientBuilder
impl UnwindSafe for DanubeClientBuilder
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
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>
T in a tonic::Request