danube_client

Struct DanubeClientBuilder

Source
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 the DanubeClient.
  • 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

Source

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.
Source

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: A ConnectionOptions instance that includes various settings for configuring the client’s connection. This may include parameters such as connection timeouts, keep alive interval.
Source

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 of DanubeClient configured with the specified options.
  • Err(e): An error if the configuration is invalid or incomplete.

Trait Implementations§

Source§

impl Clone for DanubeClientBuilder

Source§

fn clone(&self) -> DanubeClientBuilder

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DanubeClientBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DanubeClientBuilder

Source§

fn default() -> DanubeClientBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more