#[non_exhaustive]pub struct TextResourceContents {
pub mime_type: Option<String>,
pub text: String,
pub uri: String,
pub meta: Option<Map<String, Value>>,
}unstable_protocol_v2 only.Expand description
Text-based resource contents.
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.mime_type: Option<String>MIME type describing the encoded media payload.
text: StringText payload carried by this content block.
uri: StringURI associated with this resource or media payload.
meta: Option<Map<String, Value>>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 TextResourceContents
impl TextResourceContents
Sourcepub fn new(
text: impl Into<String>,
uri: impl Into<String>,
) -> TextResourceContents
pub fn new( text: impl Into<String>, uri: impl Into<String>, ) -> TextResourceContents
Builds TextResourceContents with its required content payload; optional annotations and metadata start unset.
Sourcepub fn mime_type(
self,
mime_type: impl IntoOption<String>,
) -> TextResourceContents
pub fn mime_type( self, mime_type: impl IntoOption<String>, ) -> TextResourceContents
Sets or clears the optional mimeType field.
Sourcepub fn meta(
self,
meta: impl IntoOption<Map<String, Value>>,
) -> TextResourceContents
pub fn meta( self, meta: impl IntoOption<Map<String, Value>>, ) -> TextResourceContents
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 TextResourceContents
impl Clone for TextResourceContents
Source§fn clone(&self) -> TextResourceContents
fn clone(&self) -> TextResourceContents
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 TextResourceContents
impl Debug for TextResourceContents
Source§impl<'de> Deserialize<'de> for TextResourceContents
impl<'de> Deserialize<'de> for TextResourceContents
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextResourceContents, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextResourceContents, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl IntoV1 for TextResourceContents
impl IntoV1 for TextResourceContents
Source§type Output = TextResourceContents
type Output = TextResourceContents
Source§fn into_v1(
self,
) -> Result<<TextResourceContents as IntoV1>::Output, ProtocolConversionError>
fn into_v1( self, ) -> Result<<TextResourceContents as IntoV1>::Output, ProtocolConversionError>
Source§impl JsonSchema for TextResourceContents
impl JsonSchema for TextResourceContents
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 TextResourceContents
impl PartialEq for TextResourceContents
Source§fn eq(&self, other: &TextResourceContents) -> bool
fn eq(&self, other: &TextResourceContents) -> bool
self and other values to be equal, and is used by ==.