pub struct TimeoutConfig {
pub timeout: Duration,
pub log_timeouts: bool,
pub timeout_message: String,
}
Expand description
Configuration for timeout middleware
Fields§
§timeout: Duration
Request timeout duration
log_timeouts: bool
Whether to log timeout events
timeout_message: String
Custom timeout error message
Implementations§
Source§impl TimeoutConfig
impl TimeoutConfig
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set timeout duration
Sourcepub fn with_logging(self, log_timeouts: bool) -> Self
pub fn with_logging(self, log_timeouts: bool) -> Self
Enable or disable timeout logging
Sourcepub fn with_message<S: Into<String>>(self, message: S) -> Self
pub fn with_message<S: Into<String>>(self, message: S) -> Self
Set custom timeout error message
Trait Implementations§
Source§impl Clone for TimeoutConfig
impl Clone for TimeoutConfig
Source§fn clone(&self) -> TimeoutConfig
fn clone(&self) -> TimeoutConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TimeoutConfig
impl Debug for TimeoutConfig
Auto Trait Implementations§
impl Freeze for TimeoutConfig
impl RefUnwindSafe for TimeoutConfig
impl Send for TimeoutConfig
impl Sync for TimeoutConfig
impl Unpin for TimeoutConfig
impl UnwindSafe for TimeoutConfig
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
Mutably borrows from an owned value. Read more