pub struct Resource {
pub uri: String,
pub name: String,
pub description: Option<String>,
pub mime_type: Option<String>,
pub annotations: Option<Annotations>,
pub size: Option<i64>,
}Expand description
A known resource that the server is capable of reading.
Fields§
§uri: StringThe URI of this resource.
name: StringA human-readable name for this resource.
description: Option<String>A description of what this resource represents.
mime_type: Option<String>The MIME type of this resource, if known.
annotations: Option<Annotations>Optional annotations for the client.
size: Option<i64>The size of the raw resource content in bytes, if known.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn with_description(
uri: impl Into<String>,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn with_description( uri: impl Into<String>, name: impl Into<String>, description: impl Into<String>, ) -> Self
Create a new resource with description
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
pub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
Set the MIME type for the resource
Sourcepub fn with_annotations(self, annotations: Annotations) -> Self
pub fn with_annotations(self, annotations: Annotations) -> Self
Set the annotations for the resource
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resource
impl<'de> Deserialize<'de> for Resource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Resource
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnsafeUnpin for Resource
impl UnwindSafe for Resource
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