pub struct TransportConfig {Show 13 fields
pub DefaultTimeout: Duration,
pub MaximumRetries: u32,
pub RetryBaseDelay: Duration,
pub RetryMaximumDelay: Duration,
pub RetryJitterEnabled: bool,
pub CircuitBreakerFailureThreshold: u32,
pub CircuitBreakerResetTimeout: Duration,
pub HealthChecksEnabled: bool,
pub HealthCheckInterval: Duration,
pub MetricsEnabled: bool,
pub TransportConfigurations: HashMap<TransportType, Value>,
pub AllowedTransports: Vec<TransportType>,
pub ForbiddenTransports: Vec<TransportType>,
}Expand description
Global transport configuration.
Fields§
§DefaultTimeout: DurationDefault timeout for requests that don’t specify one.
MaximumRetries: u32Maximum number of retry attempts for retryable errors.
RetryBaseDelay: DurationBase retry delay for exponential backoff.
RetryMaximumDelay: DurationMaximum retry delay cap (prevents extremely long backoffs).
RetryJitterEnabled: boolWhether retry with jitter is enabled (recommended for distributed systems).
CircuitBreakerFailureThreshold: u32Circuit breaker failure threshold (number of consecutive failures before opening).
CircuitBreakerResetTimeout: DurationCircuit breaker reset timeout (how long to wait before half-open).
HealthChecksEnabled: boolWhether health checks are enabled.
HealthCheckInterval: DurationHealth check interval (how often to perform health checks).
MetricsEnabled: boolMetrics collection enabled flag.
TransportConfigurations: HashMap<TransportType, Value>Transport-specific configuration overrides.
AllowedTransports: Vec<TransportType>Allowed transport types for auto-selection.
ForbiddenTransports: Vec<TransportType>Forbidden transport types (never used even if available).
Implementations§
Source§impl TransportConfig
impl TransportConfig
Sourcepub fn WithDefaultTimeout(self, Timeout: Duration) -> Self
pub fn WithDefaultTimeout(self, Timeout: Duration) -> Self
Sets the default request timeout.
Sourcepub fn WithMaximumRetries(self, MaximumRetries: u32) -> Self
pub fn WithMaximumRetries(self, MaximumRetries: u32) -> Self
Sets the maximum number of retry attempts.
Sourcepub fn WithRetryBaseDelay(self, Delay: Duration) -> Self
pub fn WithRetryBaseDelay(self, Delay: Duration) -> Self
Sets the base retry delay for exponential backoff.
Sourcepub fn WithRetryMaximumDelay(self, Delay: Duration) -> Self
pub fn WithRetryMaximumDelay(self, Delay: Duration) -> Self
Sets the maximum retry delay cap.
Sourcepub fn WithRetryJitter(self, Enabled: bool) -> Self
pub fn WithRetryJitter(self, Enabled: bool) -> Self
Enables or disables retry jitter.
Sourcepub fn WithCircuitBreakerThreshold(self, Threshold: u32) -> Self
pub fn WithCircuitBreakerThreshold(self, Threshold: u32) -> Self
Sets the circuit breaker failure threshold.
Sourcepub fn WithCircuitBreakerResetTimeout(self, Timeout: Duration) -> Self
pub fn WithCircuitBreakerResetTimeout(self, Timeout: Duration) -> Self
Sets the circuit breaker reset timeout.
Sourcepub fn WithHealthChecksEnabled(self, Enabled: bool) -> Self
pub fn WithHealthChecksEnabled(self, Enabled: bool) -> Self
Enables or disables health checks.
Sourcepub fn WithHealthCheckInterval(self, Interval: Duration) -> Self
pub fn WithHealthCheckInterval(self, Interval: Duration) -> Self
Sets the health check interval.
Sourcepub fn WithMetricsEnabled(self, Enabled: bool) -> Self
pub fn WithMetricsEnabled(self, Enabled: bool) -> Self
Enables or disables metrics collection.
Sourcepub fn WithTransportConfiguration(
self,
TransportKind: TransportType,
Configuration: Value,
) -> Self
pub fn WithTransportConfiguration( self, TransportKind: TransportType, Configuration: Value, ) -> Self
Adds a transport-specific configuration override.
Sourcepub fn GetTransportConfiguration(
&self,
TransportKind: TransportType,
) -> Option<&Value>
pub fn GetTransportConfiguration( &self, TransportKind: TransportType, ) -> Option<&Value>
Gets the transport-specific configuration for the given type, if any.
Sourcepub fn WithAllowedTransports(self, Transports: Vec<TransportType>) -> Self
pub fn WithAllowedTransports(self, Transports: Vec<TransportType>) -> Self
Sets the allowed transport types for auto-selection.
Sourcepub fn AddForbiddenTransport(self, TransportKind: TransportType) -> Self
pub fn AddForbiddenTransport(self, TransportKind: TransportType) -> Self
Adds a forbidden transport type.
Sourcepub fn WithForbiddenTransport(self, TransportKind: TransportType) -> Self
pub fn WithForbiddenTransport(self, TransportKind: TransportType) -> Self
Alias for AddForbiddenTransport.
Sourcepub fn IsAllowed(&self, TransportKind: TransportType) -> bool
pub fn IsAllowed(&self, TransportKind: TransportType) -> bool
Checks if a transport type is allowed by this configuration.
Sourcepub fn EffectiveTimeout(
&self,
RequestTimeoutMilliseconds: Option<u64>,
) -> Duration
pub fn EffectiveTimeout( &self, RequestTimeoutMilliseconds: Option<u64>, ) -> Duration
Gets the effective timeout for a request, considering request-specific overrides.
Sourcepub fn EffectiveRetryDelay(&self, Attempt: u32) -> Duration
pub fn EffectiveRetryDelay(&self, Attempt: u32) -> Duration
Gets the effective retry delay for a given attempt number, considering jitter.
Trait Implementations§
Source§impl Clone for TransportConfig
impl Clone for TransportConfig
Source§fn clone(&self) -> TransportConfig
fn clone(&self) -> TransportConfig
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 TransportConfig
impl Debug for TransportConfig
Source§impl Default for TransportConfig
impl Default for TransportConfig
Source§impl<'de> Deserialize<'de> for TransportConfig
impl<'de> Deserialize<'de> for TransportConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TransportConfig
impl RefUnwindSafe for TransportConfig
impl Send for TransportConfig
impl Sync for TransportConfig
impl Unpin for TransportConfig
impl UnsafeUnpin for TransportConfig
impl UnwindSafe for TransportConfig
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,
§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more