pub struct TimeoutConfig {
pub default_timeout: Duration,
pub connect_timeout: Duration,
pub request_timeout: Duration,
pub response_timeout: Duration,
pub tool_execution_timeout: Duration,
pub resource_read_timeout: Duration,
pub prompt_generation_timeout: Duration,
pub sampling_timeout: Duration,
pub completion_timeout: Duration,
pub shutdown_timeout: Duration,
pub heartbeat_interval: Duration,
}Expand description
Timeout configuration for MCP operations
This is the original timeout config, now with base config support
Fields§
§default_timeout: DurationDefault timeout for all operations
connect_timeout: DurationTimeout for connection establishment
request_timeout: DurationTimeout for individual requests
response_timeout: DurationTimeout for receiving responses
tool_execution_timeout: DurationTimeout for tool execution
resource_read_timeout: DurationTimeout for resource reading
prompt_generation_timeout: DurationTimeout for prompt generation
sampling_timeout: DurationTimeout for sampling operations
completion_timeout: DurationTimeout for completion operations
shutdown_timeout: DurationTimeout for shutdown operations
heartbeat_interval: DurationHeartbeat interval for connection health
Implementations§
Source§impl TimeoutConfig
impl TimeoutConfig
Sourcepub fn high_performance() -> Self
pub fn high_performance() -> Self
Create a high-performance configuration with shorter timeouts
Sourcepub fn long_running() -> Self
pub fn long_running() -> Self
Create a long-running configuration with extended timeouts
Sourcepub fn get_timeout_for_operation(&self, operation: &str) -> Duration
pub fn get_timeout_for_operation(&self, operation: &str) -> Duration
Get timeout for a specific operation type
Sourcepub fn validate_timeout(&self, timeout: Duration) -> bool
pub fn validate_timeout(&self, timeout: Duration) -> bool
Check if a timeout value is valid
Trait Implementations§
Source§impl BaseConfig for TimeoutConfig
impl BaseConfig for TimeoutConfig
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 ConfigDefaults for TimeoutConfig
impl ConfigDefaults for TimeoutConfig
fn default_timeout() -> Duration
fn default_retries() -> u32
fn default_backoff_multiplier() -> f64
fn default_host() -> String
fn default_port() -> u16
Source§impl Debug for TimeoutConfig
impl Debug for TimeoutConfig
Source§impl Default for TimeoutConfig
impl Default for TimeoutConfig
Source§impl<'de> Deserialize<'de> for TimeoutConfig
impl<'de> Deserialize<'de> for TimeoutConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TimeoutConfig
impl PartialEq for TimeoutConfig
Source§impl Serialize for TimeoutConfig
impl Serialize for TimeoutConfig
impl StructuralPartialEq 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