#[non_exhaustive]pub enum ContentPart {
Text(TextContent),
Json(JsonContent),
Artifact(Box<ArtifactRef>),
}Expand description
A closed v1 content value used across runtime boundaries.
Protocol adapters ingest inline bytes and URLs into the artifact boundary before constructing this enum. Consequently no variant can carry raw bytes, base64 text, storage coordinates, or a permanent remote URL.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text(TextContent)
Validated inline UTF-8 text.
Json(JsonContent)
Resource-bounded structured JSON.
Artifact(Box<ArtifactRef>)
A tenant-scoped immutable artifact reference.
Implementations§
Source§impl ContentPart
impl ContentPart
Sourcepub const fn metadata(&self) -> &ContentMetadata
pub const fn metadata(&self) -> &ContentMetadata
Returns security metadata common to every content variant.
Sourcepub fn inline_payload_bytes(&self) -> usize
pub fn inline_payload_bytes(&self) -> usize
Returns materialized text or compact JSON payload bytes held inline.
Artifact bytes are external to the domain value and therefore count as zero. The independently bounded artifact reference metadata remains in the enclosing wire object.
Trait Implementations§
Source§impl Clone for ContentPart
impl Clone for ContentPart
Source§impl Debug for ContentPart
impl Debug for ContentPart
Source§impl<'de> Deserialize<'de> for ContentPart
impl<'de> Deserialize<'de> for ContentPart
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
impl Eq for ContentPart
Source§impl From<ArtifactRef> for ContentPart
impl From<ArtifactRef> for ContentPart
Source§fn from(value: ArtifactRef) -> Self
fn from(value: ArtifactRef) -> Self
Converts to this type from the input type.
Source§impl From<JsonContent> for ContentPart
impl From<JsonContent> for ContentPart
Source§fn from(value: JsonContent) -> Self
fn from(value: JsonContent) -> Self
Converts to this type from the input type.
Source§impl From<TextContent> for ContentPart
impl From<TextContent> for ContentPart
Source§fn from(value: TextContent) -> Self
fn from(value: TextContent) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for ContentPart
impl JsonSchema for ContentPart
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 ContentPart
impl PartialEq for ContentPart
Source§impl Serialize for ContentPart
impl Serialize for ContentPart
impl StructuralPartialEq for ContentPart
Auto Trait Implementations§
impl Forget for ContentPart
impl Freeze for ContentPart
impl Move for ContentPart
impl RefUnwindSafe for ContentPart
impl Send for ContentPart
impl Sync for ContentPart
impl Unpin for ContentPart
impl UnsafeUnpin for ContentPart
impl UnwindSafe for ContentPart
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