pub struct NativeClientConfig {
pub endpoint: SocketAddr,
pub auth_token: Option<Arc<str>>,
pub max_frame_bytes: usize,
pub request_timeout: Duration,
pub max_connections: usize,
pub allow_insecure_remote: bool,
}Expand description
Connection and bounded-request settings for ShardTelemetryClient.
Fields§
§endpoint: SocketAddrNative TCP address of the ShardTelemetry server.
auth_token: Option<Arc<str>>Bearer token sent as the first native frame when configured.
max_frame_bytes: usizeLargest accepted response payload.
request_timeout: DurationDeadline for one authenticate, append, query, or health exchange.
max_connections: usizeMaximum persistent native connections to this endpoint.
Each connection carries one exchange at a time. A pool larger than one lets independent partition appends make progress concurrently while bounding sockets, authentication handshakes, and server admission.
allow_insecure_remote: boolExplicitly permits raw TCP to a non-loopback endpoint.
Production callers should leave this false and use a local mTLS tunnel or a TLS-capable transport endpoint. Native bearer authentication is a protocol frame and must never traverse an untrusted network in clear text.
Implementations§
Source§impl NativeClientConfig
impl NativeClientConfig
Sourcepub fn new(endpoint: SocketAddr) -> Self
pub fn new(endpoint: SocketAddr) -> Self
Creates a client configuration with production frame and timeout defaults.
Sourcepub fn with_auth_token(self, auth_token: impl Into<Arc<str>>) -> Self
pub fn with_auth_token(self, auth_token: impl Into<Arc<str>>) -> Self
Configures the bearer token required by production servers.
Sourcepub const fn with_max_frame_bytes(self, max_frame_bytes: usize) -> Self
pub const fn with_max_frame_bytes(self, max_frame_bytes: usize) -> Self
Changes the response-frame bound for this client.
Sourcepub const fn with_request_timeout(self, request_timeout: Duration) -> Self
pub const fn with_request_timeout(self, request_timeout: Duration) -> Self
Changes the deadline for one native exchange.
Sourcepub const fn with_max_connections(self, max_connections: usize) -> Self
pub const fn with_max_connections(self, max_connections: usize) -> Self
Changes the maximum number of reusable connections to this endpoint.
Sourcepub const fn with_insecure_remote(self) -> Self
pub const fn with_insecure_remote(self) -> Self
Explicitly permits plaintext native TCP to a non-loopback endpoint.
This exists for a locally administered TLS/service-mesh tunnel whose remote encryption boundary is outside this client. Direct internet or LAN use is unsafe; prefer the default fail-closed setting.
Trait Implementations§
Source§impl Clone for NativeClientConfig
impl Clone for NativeClientConfig
Auto Trait Implementations§
impl Freeze for NativeClientConfig
impl RefUnwindSafe for NativeClientConfig
impl Send for NativeClientConfig
impl Sync for NativeClientConfig
impl Unpin for NativeClientConfig
impl UnsafeUnpin for NativeClientConfig
impl UnwindSafe for NativeClientConfig
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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>
T in a tonic::Request