#[non_exhaustive]pub struct ClientConfigProfile {
pub address: Option<String>,
pub namespace: Option<String>,
pub api_key: Option<String>,
pub tls: Option<ClientConfigTLS>,
pub codec: Option<ClientConfigCodec>,
pub grpc_meta: HashMap<String, String>,
}envconfig only.Expand description
ClientConfigProfile is profile-level configuration for a client.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.address: Option<String>Client address
namespace: Option<String>Client namespace
api_key: Option<String>Client API key. If present and TLS field is None or present and not disabled (i.e. without Disabled as true), TLS is defaulted to enabled.
tls: Option<ClientConfigTLS>Optional client TLS config.
codec: Option<ClientConfigCodec>Optional client codec config.
grpc_meta: HashMap<String, String>Client gRPC metadata (aka headers). When loading from TOML and env var, or writing to TOML, the keys are lowercased and underscores are replaced with hyphens. This is used for deduplicating/overriding too, so manually set values that are not normalized may not get overridden when applying environment variables.
Implementations§
Source§impl ClientConfigProfile
impl ClientConfigProfile
Sourcepub fn builder() -> ClientConfigProfileBuilder
pub fn builder() -> ClientConfigProfileBuilder
Create an instance of ClientConfigProfile using the builder syntax
Source§impl ClientConfigProfile
impl ClientConfigProfile
Sourcepub fn load_from_env(
&mut self,
env_vars: Option<&HashMap<String, String>>,
) -> Result<(), ConfigError>
pub fn load_from_env( &mut self, env_vars: Option<&HashMap<String, String>>, ) -> Result<(), ConfigError>
Apply environment variable overrides to this profile.
If env_vars is None, the system’s environment variables will be used as the source.
Trait Implementations§
Source§impl Clone for ClientConfigProfile
impl Clone for ClientConfigProfile
Source§fn clone(&self) -> ClientConfigProfile
fn clone(&self) -> ClientConfigProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientConfigProfile
impl Debug for ClientConfigProfile
Source§impl Default for ClientConfigProfile
impl Default for ClientConfigProfile
Source§fn default() -> ClientConfigProfile
fn default() -> ClientConfigProfile
Source§impl PartialEq for ClientConfigProfile
impl PartialEq for ClientConfigProfile
impl StructuralPartialEq for ClientConfigProfile
Source§impl TryFrom<ClientConfigProfile> for ConnectionOptions
impl TryFrom<ClientConfigProfile> for ConnectionOptions
Source§type Error = ConfigError
type Error = ConfigError
Auto Trait Implementations§
impl Freeze for ClientConfigProfile
impl RefUnwindSafe for ClientConfigProfile
impl Send for ClientConfigProfile
impl Sync for ClientConfigProfile
impl Unpin for ClientConfigProfile
impl UnsafeUnpin for ClientConfigProfile
impl UnwindSafe for ClientConfigProfile
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