pub struct ClientContextConfig {
pub auto_generate_request_id: bool,
pub auto_generate_trace_id: bool,
pub default_tenant_id: Option<String>,
pub default_context: Option<Context>,
}Expand description
客户端上下文拦截器配置
Fields§
§auto_generate_request_id: bool是否自动生成 request_id(默认 true)
auto_generate_trace_id: bool是否自动生成 trace_id(默认 true)
default_tenant_id: Option<String>默认 tenant_id(如果提供,会自动添加到所有请求)
default_context: Option<Context>默认 Context(如果提供,会合并到所有请求)
Implementations§
Source§impl ClientContextConfig
impl ClientContextConfig
pub fn new() -> ClientContextConfig
pub fn with_default_tenant_id( self, tenant_id: impl Into<String>, ) -> ClientContextConfig
pub fn with_default_context(self, ctx: Context) -> ClientContextConfig
pub fn disable_auto_request_id(self) -> ClientContextConfig
pub fn disable_auto_trace_id(self) -> ClientContextConfig
Trait Implementations§
Source§impl Clone for ClientContextConfig
impl Clone for ClientContextConfig
Source§fn clone(&self) -> ClientContextConfig
fn clone(&self) -> ClientContextConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ClientContextConfig
impl Debug for ClientContextConfig
Source§impl Default for ClientContextConfig
impl Default for ClientContextConfig
Source§fn default() -> ClientContextConfig
fn default() -> ClientContextConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ClientContextConfig
impl !UnwindSafe for ClientContextConfig
impl Freeze for ClientContextConfig
impl Send for ClientContextConfig
impl Sync for ClientContextConfig
impl Unpin for ClientContextConfig
impl UnsafeUnpin for ClientContextConfig
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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