pub struct TemplateContext {
pub server_name: String,
pub server_version: String,
pub tools: Vec<ToolDefinition>,
pub metadata: HashMap<String, Value>,
}Expand description
Template context for code generation.
Contains all the data needed to render a Handlebars template. This is typically constructed from MCP server information.
§Examples
use mcp_execution_codegen::TemplateContext;
use std::collections::HashMap;
let context = TemplateContext {
server_name: "github".to_string(),
server_version: "1.0.0".to_string(),
tools: vec![],
metadata: HashMap::new(),
};
assert_eq!(context.server_name, "github");Fields§
§server_name: StringName of the MCP server
server_version: StringServer version string
tools: Vec<ToolDefinition>List of tool definitions
metadata: HashMap<String, Value>Additional metadata for template rendering
Trait Implementations§
Source§impl Clone for TemplateContext
impl Clone for TemplateContext
Source§fn clone(&self) -> TemplateContext
fn clone(&self) -> TemplateContext
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 TemplateContext
impl Debug for TemplateContext
Source§impl<'de> Deserialize<'de> for TemplateContext
impl<'de> Deserialize<'de> for TemplateContext
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
Auto Trait Implementations§
impl Freeze for TemplateContext
impl RefUnwindSafe for TemplateContext
impl Send for TemplateContext
impl Sync for TemplateContext
impl Unpin for TemplateContext
impl UnwindSafe for TemplateContext
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