Struct NetworkConfig

Source
pub struct NetworkConfig {
Show 13 fields pub connect_timeout_in_ms: u64, pub request_timeout_in_ms: u64, pub concurrency_limit_per_connection: usize, pub max_concurrent_streams: u32, pub tcp_nodelay: bool, pub tcp_keepalive_in_secs: u64, pub http2_keep_alive_interval_in_secs: u64, pub http2_keep_alive_timeout_in_secs: u64, pub max_frame_size: u32, pub initial_connection_window_size: u32, pub initial_stream_window_size: u32, pub buffer_size: usize, pub http2_adaptive_window: bool,
}
Expand description

Network communication configuration for gRPC/HTTP2 transport

Provides fine-grained control over low-level network parameters

Fields§

§connect_timeout_in_ms: u64

Timeout for establishing TCP connections in milliseconds Default: 20ms (suitable for LAN environments)

§request_timeout_in_ms: u64

Maximum duration for completing gRPC requests in milliseconds Default: 100ms (adjust based on RPC complexity)

§concurrency_limit_per_connection: usize

Maximum concurrent requests per connection Default: 8192 (matches typical gRPC server settings)

§max_concurrent_streams: u32

HTTP2 SETTINGS_MAX_CONCURRENT_STREAMS value Default: 100 (controls concurrent streams per connection)

§tcp_nodelay: bool

Enable TCP_NODELAY to disable Nagle’s algorithm Default: true (recommended for low-latency scenarios)

§tcp_keepalive_in_secs: u64

TCP keepalive duration in seconds Default: 3600s (1 hour, OS may enforce minimum values)

§http2_keep_alive_interval_in_secs: u64

HTTP2 keepalive ping interval in seconds Default: 300s (5 minutes)

§http2_keep_alive_timeout_in_secs: u64

HTTP2 keepalive timeout in seconds Default: 20s (must be < interval)

§max_frame_size: u32

Maximum HTTP2 frame size in bytes Default: 12MB (12582912 bytes)

§initial_connection_window_size: u32

Initial connection-level flow control window in bytes Default: 12MB (12582912 bytes)

§initial_stream_window_size: u32

Initial per-stream flow control window in bytes Default: 2MB (2097152 bytes)

§buffer_size: usize

I/O buffer size in bytes Default: 64KB (65536 bytes)

§http2_adaptive_window: bool

Enable adaptive flow control window sizing When enabled, overrides initial window size settings Default: false (use fixed window sizes)

Implementations§

Source§

impl NetworkConfig

Source

pub fn validate(&self) -> Result<()>

Validates network configuration consistency and safety Returns Error::InvalidConfig with detailed message if any rule fails

Trait Implementations§

Source§

impl Clone for NetworkConfig

Source§

fn clone(&self) -> NetworkConfig

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NetworkConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NetworkConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for NetworkConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for NetworkConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T