colmugx/mcp/protocol/resource does not have a README file

    Resource

    pub(open) trait Resource {
    fn name(Self) -> String
    fn description(Self) -> String
    fn uri(Self) -> String
    fn mime_type(Self) -> String
    async fn read(Self) -> Result[ResourceReadResult,
    MCPError
    ]
    }

    Core Resource trait following MCP protocol
    • name: Resource identifier (unique)
    • description: Human-readable description
    • uri: Resource URI (e.g., "file:///path/to/file")
    • mime_type: MIME type of the resource content
    • read: Async read operation returning resource content

    ResourceContent

    pub(all) enum ResourceContent {
    Text(String)
    Blob(String, String)
    } derive(Eq,
    Debug
    )

    Content type for MCP resource read results Supports text and binary blob content types per MCP spec

    ResourceDefinition

    pub(all) struct ResourceDefinition {
    uri : String
    name : String
    description : String?
    mime_type : String?
    } derive(Eq,
    Debug
    )

    Resource metadata definition (for protocol responses) Describes a resource in the resources/list response Note: This is separate from the Resource trait which is for implementation

    ResourceReadResult

    pub(all) struct ResourceReadResult {
    uri : String
    content : ResourceContent
    } derive(Eq,
    Debug
    )

    Result of reading a resource Contains the URI and content of the resource

    Source Files