#[non_exhaustive]pub struct EmbeddedResource {
pub resource: ResourceContents,
pub meta: Option<MetaObject>,
pub annotations: Option<Annotations>,
}Expand description
Embedded resource content (spec EmbeddedResource).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.resource: ResourceContentsThe embedded resource contents (text or blob).
meta: Option<MetaObject>Optional protocol-level metadata for this content block.
annotations: Option<Annotations>Optional annotations describing how the client should use this content.
Implementations§
Source§impl EmbeddedResource
impl EmbeddedResource
pub fn new(resource: ResourceContents) -> Self
pub fn get_text(&self) -> String
pub fn with_meta(self, meta: MetaObject) -> Self
pub fn with_annotations(self, annotations: Annotations) -> Self
Trait Implementations§
Source§impl Clone for EmbeddedResource
impl Clone for EmbeddedResource
Source§impl Debug for EmbeddedResource
impl Debug for EmbeddedResource
Source§impl<'de> Deserialize<'de> for EmbeddedResource
impl<'de> Deserialize<'de> for EmbeddedResource
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for EmbeddedResource
Available on crate feature schemars only.
impl JsonSchema for EmbeddedResource
Available on crate feature
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for EmbeddedResource
impl PartialEq for EmbeddedResource
Source§impl Serialize for EmbeddedResource
impl Serialize for EmbeddedResource
impl StructuralPartialEq for EmbeddedResource
Auto Trait Implementations§
impl Freeze for EmbeddedResource
impl RefUnwindSafe for EmbeddedResource
impl Send for EmbeddedResource
impl Sync for EmbeddedResource
impl Unpin for EmbeddedResource
impl UnsafeUnpin for EmbeddedResource
impl UnwindSafe for EmbeddedResource
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