Skip to main content

TransportConfig

Struct TransportConfig 

Source
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: Duration

Default timeout for requests that don’t specify one.

§MaximumRetries: u32

Maximum number of retry attempts for retryable errors.

§RetryBaseDelay: Duration

Base retry delay for exponential backoff.

§RetryMaximumDelay: Duration

Maximum retry delay cap (prevents extremely long backoffs).

§RetryJitterEnabled: bool

Whether retry with jitter is enabled (recommended for distributed systems).

§CircuitBreakerFailureThreshold: u32

Circuit breaker failure threshold (number of consecutive failures before opening).

§CircuitBreakerResetTimeout: Duration

Circuit breaker reset timeout (how long to wait before half-open).

§HealthChecksEnabled: bool

Whether health checks are enabled.

§HealthCheckInterval: Duration

Health check interval (how often to perform health checks).

§MetricsEnabled: bool

Metrics 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

Source

pub fn New() -> Self

Creates a new TransportConfig with default values.

Source

pub fn WithDefaultTimeout(self, Timeout: Duration) -> Self

Sets the default request timeout.

Source

pub fn WithMaximumRetries(self, MaximumRetries: u32) -> Self

Sets the maximum number of retry attempts.

Source

pub fn WithRetryBaseDelay(self, Delay: Duration) -> Self

Sets the base retry delay for exponential backoff.

Source

pub fn WithRetryMaximumDelay(self, Delay: Duration) -> Self

Sets the maximum retry delay cap.

Source

pub fn WithRetryJitter(self, Enabled: bool) -> Self

Enables or disables retry jitter.

Source

pub fn WithCircuitBreakerThreshold(self, Threshold: u32) -> Self

Sets the circuit breaker failure threshold.

Source

pub fn WithCircuitBreakerResetTimeout(self, Timeout: Duration) -> Self

Sets the circuit breaker reset timeout.

Source

pub fn WithHealthChecksEnabled(self, Enabled: bool) -> Self

Enables or disables health checks.

Source

pub fn WithHealthCheckInterval(self, Interval: Duration) -> Self

Sets the health check interval.

Source

pub fn WithMetricsEnabled(self, Enabled: bool) -> Self

Enables or disables metrics collection.

Source

pub fn WithTransportConfiguration( self, TransportKind: TransportType, Configuration: Value, ) -> Self

Adds a transport-specific configuration override.

Source

pub fn GetTransportConfiguration( &self, TransportKind: TransportType, ) -> Option<&Value>

Gets the transport-specific configuration for the given type, if any.

Source

pub fn WithAllowedTransports(self, Transports: Vec<TransportType>) -> Self

Sets the allowed transport types for auto-selection.

Source

pub fn AddForbiddenTransport(self, TransportKind: TransportType) -> Self

Adds a forbidden transport type.

Source

pub fn WithForbiddenTransport(self, TransportKind: TransportType) -> Self

Alias for AddForbiddenTransport.

Source

pub fn IsAllowed(&self, TransportKind: TransportType) -> bool

Checks if a transport type is allowed by this configuration.

Source

pub fn EffectiveTimeout( &self, RequestTimeoutMilliseconds: Option<u64>, ) -> Duration

Gets the effective timeout for a request, considering request-specific overrides.

Source

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

Source§

fn clone(&self) -> TransportConfig

Returns a duplicate 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 TransportConfig

Source§

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

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

impl Default for TransportConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for TransportConfig

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 TransportConfig

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
§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the [CommandItem]. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

§

impl<T> IpcResponse for T
where T: Serialize,

§

fn body(self) -> Result<InvokeResponseBody, Error>

Resolve the IPC response body.
§

impl<T> ScopeObject for T
where T: Send + Sync + Debug + DeserializeOwned + 'static,

§

type Error = Error

The error type.
§

fn deserialize<R>( _app: &AppHandle<R>, raw: Value, ) -> Result<T, <T as ScopeObject>::Error>
where R: Runtime,

Deserialize the raw scope value.
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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<T> AutoreleaseSafe for T
where T: ?Sized,

Source§

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

§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,