pub struct MountainClientConfig {
pub address: String,
pub connection_timeout_secs: u64,
pub request_timeout_secs: u64,
pub tls_config: Option<TlsConfig>,
}Expand description
Configuration for connecting to Mountain.
Fields§
§address: StringThe gRPC server address of Mountain (e.g., "[::1]:50051")
connection_timeout_secs: u64Connection timeout in seconds
request_timeout_secs: u64Request timeout in seconds
tls_config: Option<TlsConfig>TLS configuration (if mtls feature is enabled)
Implementations§
Source§impl MountainClientConfig
impl MountainClientConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates a MountainClientConfig from environment variables.
This method reads configuration from the following environment variables:
MOUNTAIN_ADDRESS: gRPC server address (default:"[::1]:50051")MOUNTAIN_CONNECTION_TIMEOUT_SECS: Connection timeout in seconds (default: 5)MOUNTAIN_REQUEST_TIMEOUT_SECS: Request timeout in seconds (default: 30)MOUNTAIN_TLS_ENABLED: Enable TLS if set to “1” or “true”MOUNTAIN_CA_CERT: Path to CA certificate fileMOUNTAIN_CLIENT_CERT: Path to client certificate fileMOUNTAIN_CLIENT_KEY: Path to client private key fileMOUNTAIN_SERVER_NAME: Server name for SNIMOUNTAIN_VERIFY_CERTS: Verify certificates (default: true, set to “0” or “false” to disable)
§Returns
New MountainClientConfig instance loaded from environment
Sourcepub fn with_connection_timeout(self, timeout_secs: u64) -> Self
pub fn with_connection_timeout(self, timeout_secs: u64) -> Self
Sourcepub fn with_request_timeout(self, timeout_secs: u64) -> Self
pub fn with_request_timeout(self, timeout_secs: u64) -> Self
Trait Implementations§
Source§impl Clone for MountainClientConfig
impl Clone for MountainClientConfig
Source§fn clone(&self) -> MountainClientConfig
fn clone(&self) -> MountainClientConfig
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 moreSource§impl Debug for MountainClientConfig
impl Debug for MountainClientConfig
Auto Trait Implementations§
impl Freeze for MountainClientConfig
impl RefUnwindSafe for MountainClientConfig
impl Send for MountainClientConfig
impl Sync for MountainClientConfig
impl Unpin for MountainClientConfig
impl UnwindSafe for MountainClientConfig
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].