pub trait ParameterExt {
// Required methods
fn get_string(&self, key: &str) -> McpResult<&str>;
fn get_optional_string(&self, key: &str) -> Option<&str>;
fn get_number(&self, key: &str) -> McpResult<f64>;
fn get_optional_number(&self, key: &str) -> Option<f64>;
fn get_integer(&self, key: &str) -> McpResult<i64>;
fn get_optional_integer(&self, key: &str) -> Option<i64>;
fn get_boolean(&self, key: &str) -> McpResult<bool>;
fn get_optional_boolean(&self, key: &str) -> Option<bool>;
}
Expand description
Extension trait for HashMap to make parameter extraction easier
Required Methods§
Sourcefn get_string(&self, key: &str) -> McpResult<&str>
fn get_string(&self, key: &str) -> McpResult<&str>
Extract a required string parameter
Sourcefn get_optional_string(&self, key: &str) -> Option<&str>
fn get_optional_string(&self, key: &str) -> Option<&str>
Extract an optional string parameter
Sourcefn get_number(&self, key: &str) -> McpResult<f64>
fn get_number(&self, key: &str) -> McpResult<f64>
Extract a required number parameter
Sourcefn get_optional_number(&self, key: &str) -> Option<f64>
fn get_optional_number(&self, key: &str) -> Option<f64>
Extract an optional number parameter
Sourcefn get_integer(&self, key: &str) -> McpResult<i64>
fn get_integer(&self, key: &str) -> McpResult<i64>
Extract a required integer parameter
Sourcefn get_optional_integer(&self, key: &str) -> Option<i64>
fn get_optional_integer(&self, key: &str) -> Option<i64>
Extract an optional integer parameter
Sourcefn get_boolean(&self, key: &str) -> McpResult<bool>
fn get_boolean(&self, key: &str) -> McpResult<bool>
Extract a required boolean parameter
Sourcefn get_optional_boolean(&self, key: &str) -> Option<bool>
fn get_optional_boolean(&self, key: &str) -> Option<bool>
Extract an optional boolean parameter