pub struct ResourcesClient { /* private fields */ }Expand description
MCP Resources client for managing and accessing resources.
Implementations§
Source§impl ResourcesClient
impl ResourcesClient
Sourcepub async fn list(&self) -> Result<ResourceListResult>
pub async fn list(&self) -> Result<ResourceListResult>
List all available resources.
In a full implementation, this would call resources/list on the MCP server.
Sourcepub async fn read(&self, uri: &str) -> Result<ResourceContents>
pub async fn read(&self, uri: &str) -> Result<ResourceContents>
Read a resource by URI.
In a full implementation, this would call resources/read on the MCP server.
Sourcepub async fn list_templates(&self) -> Result<ResourceTemplateListResult>
pub async fn list_templates(&self) -> Result<ResourceTemplateListResult>
List available resource templates.
In a full implementation, this would call resources/templates/list.
Sourcepub async fn unsubscribe(&self, uri: &str) -> Result<()>
pub async fn unsubscribe(&self, uri: &str) -> Result<()>
Unsubscribe from resource changes.
Sourcepub fn subscriptions(&self) -> Vec<String>
pub fn subscriptions(&self) -> Vec<String>
Get list of subscribed resources.
Sourcepub fn register_template(&self, template: ResourceTemplate)
pub fn register_template(&self, template: ResourceTemplate)
Register a template (for testing/local use).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ResourcesClient
impl RefUnwindSafe for ResourcesClient
impl Send for ResourcesClient
impl Sync for ResourcesClient
impl Unpin for ResourcesClient
impl UnsafeUnpin for ResourcesClient
impl UnwindSafe for ResourcesClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request