pub struct ResourceReadResult {
pub contents: Vec<ResourceContentItem>,
}Expand description
Result of reading a resource.
Fields§
§contents: Vec<ResourceContentItem>The content items.
Implementations§
Source§impl ResourceReadResult
impl ResourceReadResult
Sourcepub fn new(contents: Vec<ResourceContentItem>) -> Self
pub fn new(contents: Vec<ResourceContentItem>) -> Self
Creates a new resource read result with the given contents.
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 single-item text result.
Sourcepub fn first_text(&self) -> Option<&str>
pub fn first_text(&self) -> Option<&str>
Returns the first text content, if present.
Sourcepub fn first_blob(&self) -> Option<&str>
pub fn first_blob(&self) -> Option<&str>
Returns the first blob content, if present.
Trait Implementations§
Source§impl Clone for ResourceReadResult
impl Clone for ResourceReadResult
Source§fn clone(&self) -> ResourceReadResult
fn clone(&self) -> ResourceReadResult
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 ResourceReadResult
impl RefUnwindSafe for ResourceReadResult
impl Send for ResourceReadResult
impl Sync for ResourceReadResult
impl Unpin for ResourceReadResult
impl UnwindSafe for ResourceReadResult
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).