pub struct ResourceContentItem {
pub uri: String,
pub mime_type: Option<String>,
pub text: Option<String>,
pub blob: Option<String>,
}Expand description
A single item of resource content.
Mirrors the protocol’s ResourceContent but lives in core to avoid circular dependencies.
Fields§
§uri: StringResource URI.
mime_type: Option<String>MIME type.
text: Option<String>Text content (if text).
blob: Option<String>Binary content (if blob, base64-encoded).
Implementations§
Source§impl ResourceContentItem
impl ResourceContentItem
Sourcepub fn text(uri: impl Into<String>, text: impl Into<String>) -> Self
pub fn text(uri: impl Into<String>, text: impl Into<String>) -> Self
Creates a text resource content item.
Sourcepub fn json(uri: impl Into<String>, text: impl Into<String>) -> Self
pub fn json(uri: impl Into<String>, text: impl Into<String>) -> Self
Creates a JSON resource content item.
Trait Implementations§
Source§impl Clone for ResourceContentItem
impl Clone for ResourceContentItem
Source§fn clone(&self) -> ResourceContentItem
fn clone(&self) -> ResourceContentItem
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 moreAuto Trait Implementations§
impl Freeze for ResourceContentItem
impl RefUnwindSafe for ResourceContentItem
impl Send for ResourceContentItem
impl Sync for ResourceContentItem
impl Unpin for ResourceContentItem
impl UnwindSafe for ResourceContentItem
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).