pub struct ResourceContent {
pub uri: String,
pub mime_type: Option<String>,
pub text: Option<String>,
pub blob: Option<String>,
}Available on crate feature
composition only.Expand description
Content from a resource read operation.
Fields§
§uri: StringThe URI of the resource.
mime_type: Option<String>The MIME type of the content, if known.
text: Option<String>Text content, if the resource contains text.
blob: Option<String>Binary content as base64, if the resource contains binary data.
Implementations§
Source§impl ResourceContent
impl ResourceContent
Sourcepub fn text(uri: impl Into<String>, text: impl Into<String>) -> Self
pub fn text(uri: impl Into<String>, text: impl Into<String>) -> Self
Create a new text resource content.
Sourcepub fn json(uri: impl Into<String>, text: impl Into<String>) -> Self
pub fn json(uri: impl Into<String>, text: impl Into<String>) -> Self
Create a new JSON resource content.
Trait Implementations§
Source§impl Clone for ResourceContent
impl Clone for ResourceContent
Source§impl Debug for ResourceContent
impl Debug for ResourceContent
Source§impl<'de> Deserialize<'de> for ResourceContent
impl<'de> Deserialize<'de> for ResourceContent
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
Auto Trait Implementations§
impl Freeze for ResourceContent
impl RefUnwindSafe for ResourceContent
impl Send for ResourceContent
impl Sync for ResourceContent
impl Unpin for ResourceContent
impl UnsafeUnpin for ResourceContent
impl UnwindSafe for ResourceContent
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