#[non_exhaustive]pub struct ResourceLink {
pub annotations: Option<Annotations>,
pub description: Option<String>,
pub mime_type: Option<String>,
pub name: String,
pub size: Option<i64>,
pub title: Option<String>,
pub uri: String,
pub meta: Option<Meta>,
}Expand description
A resource that the server is capable of reading, included in a prompt or tool call result.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.annotations: Option<Annotations>Optional annotations that help clients decide how to display or route this content.
description: Option<String>Optional human-readable details shown with this protocol object.
mime_type: Option<String>MIME type describing the encoded media payload.
name: StringHuman-readable name shown for this protocol object.
size: Option<i64>Optional size of the linked resource in bytes, if known.
title: Option<String>Optional display title for end-user UI.
uri: StringURI associated with this resource or media payload.
meta: Option<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl ResourceLink
impl ResourceLink
Sourcepub fn new(name: impl Into<String>, uri: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, uri: impl Into<String>) -> Self
Builds ResourceLink with its required content payload; optional annotations and metadata start unset.
Sourcepub fn annotations(self, annotations: impl IntoOption<Annotations>) -> Self
pub fn annotations(self, annotations: impl IntoOption<Annotations>) -> Self
Sets or clears the optional annotations field.
Sourcepub fn description(self, description: impl IntoOption<String>) -> Self
pub fn description(self, description: impl IntoOption<String>) -> Self
Sets or clears the optional description field.
Sourcepub fn mime_type(self, mime_type: impl IntoOption<String>) -> Self
pub fn mime_type(self, mime_type: impl IntoOption<String>) -> Self
Sets or clears the optional mimeType field.
Sourcepub fn size(self, size: impl IntoOption<i64>) -> Self
pub fn size(self, size: impl IntoOption<i64>) -> Self
Sets or clears the optional size field.
Sourcepub fn title(self, title: impl IntoOption<String>) -> Self
pub fn title(self, title: impl IntoOption<String>) -> Self
Sets or clears the optional title field.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for ResourceLink
impl Clone for ResourceLink
Source§fn clone(&self) -> ResourceLink
fn clone(&self) -> ResourceLink
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceLink
impl Debug for ResourceLink
Source§impl<'de> Deserialize<'de> for ResourceLink
impl<'de> Deserialize<'de> for ResourceLink
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>,
Source§impl IntoV2 for ResourceLink
Available on crate feature unstable_protocol_v2 only.
impl IntoV2 for ResourceLink
unstable_protocol_v2 only.Source§impl JsonSchema for ResourceLink
impl JsonSchema for ResourceLink
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ResourceLink
impl PartialEq for ResourceLink
Source§fn eq(&self, other: &ResourceLink) -> bool
fn eq(&self, other: &ResourceLink) -> bool
self and other values to be equal, and is used by ==.