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>,
}Expand description
ClientConfigProfile is profile-level configuration for a client.
Fields§
§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 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
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 ClientConfigProfile
impl Debug for ClientConfigProfile
Source§impl Default for ClientConfigProfile
impl Default for ClientConfigProfile
Source§fn default() -> ClientConfigProfile
fn default() -> ClientConfigProfile
Returns the “default value” for a type. Read more
Source§impl PartialEq for ClientConfigProfile
impl PartialEq for ClientConfigProfile
Source§impl TryFrom<ClientConfigProfile> for ConnectionOptions
impl TryFrom<ClientConfigProfile> for ConnectionOptions
Source§type Error = ConfigError
type Error = ConfigError
The type returned in the event of a conversion error.
impl StructuralPartialEq for ClientConfigProfile
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
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