pub enum ResourceKind {
ToolCount {
server_id: ServerId,
},
ToolNameLength,
DescriptionLength {
tool_name: String,
},
InputSchemaSize {
tool_name: String,
},
OutputSchemaSize {
tool_name: String,
},
GeneratedOutputSize,
GeneratedFileCount,
}Expand description
Identifies which bounded resource a Error::ResourceLimitExceeded rejection concerns.
Closes the free-form resource: String field this replaced (issue #317) into a fixed set
of variants, so a call site can no longer report a resource category via an arbitrary,
typo-prone string. Each variant carries whatever context (server or tool identity) is
needed to reproduce the same human-readable message the old ad hoc strings rendered; see
ResourceKind’s Display impl for the exact wording.
§Examples
use mcp_execution_core::ResourceKind;
use mcp_execution_core::ServerId;
let kind = ResourceKind::ToolCount {
server_id: ServerId::new("github").unwrap(),
};
assert_eq!(kind.to_string(), "tool count for server 'github'");
assert_eq!(ResourceKind::ToolNameLength.to_string(), "tool name length");Variants§
ToolCount
Number of tools a server reported (or that codegen would emit files for).
ToolNameLength
Length of a single tool’s name.
DescriptionLength
Length of a single tool’s description.
InputSchemaSize
Serialized size (bytes) of a tool’s input JSON Schema.
OutputSchemaSize
Serialized size (bytes) of a tool’s output JSON Schema.
GeneratedOutputSize
Total size (bytes) of all files generated by one generate call.
GeneratedFileCount
Total number of files produced by one generate call.
Trait Implementations§
Source§impl Clone for ResourceKind
impl Clone for ResourceKind
Source§fn clone(&self) -> ResourceKind
fn clone(&self) -> ResourceKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more