pub struct LoadedResource {
pub uri: String,
pub name: String,
pub description: Option<String>,
pub mime_type: String,
pub content: String,
pub meta: Option<Map<String, Value>>,
}Expand description
A loaded resource with resolved content.
Fields§
§uri: StringResource URI.
name: StringHuman-readable name.
description: Option<String>Optional description.
mime_type: StringMIME type.
content: StringResolved content.
meta: Option<Map<String, Value>>Optional metadata map for resource _meta.
Implementations§
Source§impl LoadedResource
impl LoadedResource
Sourcepub fn from_config(config: &ResourceConfig) -> Result<Self>
pub fn from_config(config: &ResourceConfig) -> Result<Self>
Create a LoadedResource from config with inline content.
Returns ToolkitError::Synth if config.content is absent —
content_file is not supported in this lift (Lambda runtime
constraint).
Sourcepub fn to_resource_info(&self) -> ResourceInfo
pub fn to_resource_info(&self) -> ResourceInfo
Convert to PMCP SDK ResourceInfo for listing.
Sourcepub fn to_content(&self) -> Content
pub fn to_content(&self) -> Content
Convert to PMCP SDK Content for reading.
Always uses the MIME-typed-wire shape Content::resource_with_text
(PATTERNS §5) so per-resource MIME types survive the wire round-trip.
If a downstream consumer needs _meta propagation on top of MIME, see
the threat model T-83-03-03 mitigation in plan 83-03 — a future
follow-up may add a with_meta variant. The current lift drops _meta
at the read boundary; the resource _meta is exposed through
to_resource_info() for resources/list only.
Trait Implementations§
Source§impl Clone for LoadedResource
impl Clone for LoadedResource
Source§fn clone(&self) -> LoadedResource
fn clone(&self) -> LoadedResource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LoadedResource
impl RefUnwindSafe for LoadedResource
impl Send for LoadedResource
impl Sync for LoadedResource
impl Unpin for LoadedResource
impl UnsafeUnpin for LoadedResource
impl UnwindSafe for LoadedResource
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
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: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more