pub struct ResourceReference {
pub uri: String,
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub mime_type: Option<String>,
pub annotations: Option<Annotations>,
pub meta: Option<HashMap<String, Value>>,
}
Expand description
Resource reference for resource links (matches TypeScript Resource interface)
Fields§
§uri: String
The URI of this resource
name: String
A human-readable name for this resource
title: Option<String>
A human-readable title for this resource
description: Option<String>
A description of what this resource represents or contains
mime_type: Option<String>
The MIME type of this resource, if known
annotations: Option<Annotations>
Client annotations for this resource
meta: Option<HashMap<String, Value>>
Additional metadata for this resource
Implementations§
Source§impl ResourceReference
impl ResourceReference
Sourcepub fn new(uri: impl Into<String>, name: impl Into<String>) -> ResourceReference
pub fn new(uri: impl Into<String>, name: impl Into<String>) -> ResourceReference
Create resource reference
Sourcepub fn with_title(self, title: impl Into<String>) -> ResourceReference
pub fn with_title(self, title: impl Into<String>) -> ResourceReference
Add title
Sourcepub fn with_description(
self,
description: impl Into<String>,
) -> ResourceReference
pub fn with_description( self, description: impl Into<String>, ) -> ResourceReference
Add description
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> ResourceReference
pub fn with_mime_type(self, mime_type: impl Into<String>) -> ResourceReference
Add MIME type
Sourcepub fn with_annotations(self, annotations: Annotations) -> ResourceReference
pub fn with_annotations(self, annotations: Annotations) -> ResourceReference
Add annotations
Trait Implementations§
Source§impl Clone for ResourceReference
impl Clone for ResourceReference
Source§fn clone(&self) -> ResourceReference
fn clone(&self) -> ResourceReference
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 ResourceReference
impl Debug for ResourceReference
Source§impl<'de> Deserialize<'de> for ResourceReference
impl<'de> Deserialize<'de> for ResourceReference
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResourceReference, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResourceReference, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ResourceReference
impl Serialize for ResourceReference
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ResourceReference
impl RefUnwindSafe for ResourceReference
impl Send for ResourceReference
impl Sync for ResourceReference
impl Unpin for ResourceReference
impl UnwindSafe for ResourceReference
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