pub struct RequestSettings {
pub connect_timeout: Option<Duration>,
pub timeout: Option<Duration>,
pub retries: Option<usize>,
pub ban_failed_address: Option<bool>,
pub max_decoding_message_size: Option<usize>,
}Expand description
DAPI request settings.
There are four levels of settings where each next level can override all previous ones:
- Defaults for this library;
- crate::DapiClient settings;
- crate::DapiRequest-specific settings;
- settings for an exact request execution call.
Fields§
§connect_timeout: Option<Duration>Timeout for establishing a connection.
timeout: Option<Duration>Timeout for single request (soft limit).
Note that the total maximum time of execution can exceed (timeout + connect_timeout) * retries
as it accounts for internal processing time between retries.
retries: Option<usize>Number of retries in case of failed requests. If max retries reached, the last error is returned. 1 means one request and one retry in case of error, etc.
ban_failed_address: Option<bool>Ban DAPI address if node not responded or responded with error.
max_decoding_message_size: Option<usize>Maximum gRPC response size in bytes (decoding limit).
Implementations§
Source§impl RequestSettings
impl RequestSettings
Sourcepub const fn default() -> Self
pub const fn default() -> Self
Create empty RequestSettings, which means no overrides will be applied.
Actually does the same as Default, but it’s const.
Sourcepub fn override_by(self, rhs: RequestSettings) -> Self
pub fn override_by(self, rhs: RequestSettings) -> Self
Combines two instances of RequestSettings with following rules:
Sourcepub fn finalize(self) -> AppliedRequestSettings
pub fn finalize(self) -> AppliedRequestSettings
Fill in settings defaults.
Trait Implementations§
Source§impl Clone for RequestSettings
impl Clone for RequestSettings
Source§fn clone(&self) -> RequestSettings
fn clone(&self) -> RequestSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestSettings
impl Debug for RequestSettings
Source§impl Default for RequestSettings
impl Default for RequestSettings
Source§fn default() -> RequestSettings
fn default() -> RequestSettings
impl Copy for RequestSettings
Auto Trait Implementations§
impl Freeze for RequestSettings
impl RefUnwindSafe for RequestSettings
impl Send for RequestSettings
impl Sync for RequestSettings
impl Unpin for RequestSettings
impl UnwindSafe for RequestSettings
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<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, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
impl<T, U> IntoPlatformVersioned<U> for Twhere
U: FromPlatformVersioned<T>,
Source§fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
fn into_platform_versioned(self, platform_version: &PlatformVersion) -> U
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].