pub struct Resource {
pub uri: String,
pub name: String,
pub description: Option<String>,
pub mime_type: Option<String>,
}Expand description
Resource definition including metadata and access information.
Fields§
§uri: StringUnique URI identifying the resource
name: StringHuman-readable name of the resource
description: Option<String>Description of what the resource contains
mime_type: Option<String>MIME type of the resource content
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn new(uri: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(uri: impl Into<String>, name: impl Into<String>) -> Self
Create a new resource definition.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description for this resource.
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 this 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 Eq for Resource
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.