pub struct McpResourceRegistry { /* private fields */ }Expand description
MCP Server Resource Registry for RFC 9728 compliance
Implementations§
Source§impl McpResourceRegistry
impl McpResourceRegistry
Sourcepub fn new(base_resource_uri: String, auth_server: String) -> Self
pub fn new(base_resource_uri: String, auth_server: String) -> Self
Create a new MCP resource registry
Sourcepub async fn register_resource(
&self,
resource_id: &str,
scopes: Vec<String>,
documentation: Option<String>,
) -> McpResult<()>
pub async fn register_resource( &self, resource_id: &str, scopes: Vec<String>, documentation: Option<String>, ) -> McpResult<()>
Register a protected resource (RFC 9728)
Sourcepub async fn get_resource_metadata(
&self,
resource_uri: &str,
) -> Option<ProtectedResourceMetadata>
pub async fn get_resource_metadata( &self, resource_uri: &str, ) -> Option<ProtectedResourceMetadata>
Get metadata for a specific resource
Sourcepub async fn list_resources(&self) -> Vec<String>
pub async fn list_resources(&self) -> Vec<String>
List all registered resources
Sourcepub async fn generate_well_known_metadata(
&self,
) -> HashMap<String, ProtectedResourceMetadata>
pub async fn generate_well_known_metadata( &self, ) -> HashMap<String, ProtectedResourceMetadata>
Generate RFC 9728 compliant metadata for well-known endpoint
Trait Implementations§
Source§impl Clone for McpResourceRegistry
impl Clone for McpResourceRegistry
Source§fn clone(&self) -> McpResourceRegistry
fn clone(&self) -> McpResourceRegistry
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 moreAuto Trait Implementations§
impl Freeze for McpResourceRegistry
impl !RefUnwindSafe for McpResourceRegistry
impl Send for McpResourceRegistry
impl Sync for McpResourceRegistry
impl Unpin for McpResourceRegistry
impl !UnwindSafe for McpResourceRegistry
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