Trait ParameterExt

Source
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§

Source

fn get_string(&self, key: &str) -> McpResult<&str>

Extract a required string parameter

Source

fn get_optional_string(&self, key: &str) -> Option<&str>

Extract an optional string parameter

Source

fn get_number(&self, key: &str) -> McpResult<f64>

Extract a required number parameter

Source

fn get_optional_number(&self, key: &str) -> Option<f64>

Extract an optional number parameter

Source

fn get_integer(&self, key: &str) -> McpResult<i64>

Extract a required integer parameter

Source

fn get_optional_integer(&self, key: &str) -> Option<i64>

Extract an optional integer parameter

Source

fn get_boolean(&self, key: &str) -> McpResult<bool>

Extract a required boolean parameter

Source

fn get_optional_boolean(&self, key: &str) -> Option<bool>

Extract an optional boolean parameter

Implementors§