pub struct ContentMetadata { /* private fields */ }Expand description
Security and source metadata carried by each content value.
The fields are explicit so adapters cannot silently discard trust-boundary information. This object is an auditable claim only: it does not authorize execution, declassification, logging, or conversion into an instruction.
Implementations§
Source§impl ContentMetadata
impl ContentMetadata
Sourcepub const fn new(
source: ContentSource,
trust: ContentTrust,
security_label: SecurityLabel,
redaction: RedactionState,
) -> Self
pub const fn new( source: ContentSource, trust: ContentTrust, security_label: SecurityLabel, redaction: RedactionState, ) -> Self
Constructs metadata from explicit validated components.
Sourcepub const fn untrusted(
source: ContentSource,
security_label: SecurityLabel,
) -> Self
pub const fn untrusted( source: ContentSource, security_label: SecurityLabel, ) -> Self
Constructs the common untrusted, not-yet-redacted classification.
Sourcepub const fn source(&self) -> ContentSource
pub const fn source(&self) -> ContentSource
Returns the immediate content source.
Sourcepub const fn trust(&self) -> ContentTrust
pub const fn trust(&self) -> ContentTrust
Returns the asserted trust classification.
Sourcepub const fn security_label(&self) -> &SecurityLabel
pub const fn security_label(&self) -> &SecurityLabel
Returns the opaque policy label.
Sourcepub const fn redaction(&self) -> RedactionState
pub const fn redaction(&self) -> RedactionState
Returns the redaction transformation state.
Trait Implementations§
Source§impl Clone for ContentMetadata
impl Clone for ContentMetadata
Source§impl Debug for ContentMetadata
impl Debug for ContentMetadata
Source§impl<'de> Deserialize<'de> for ContentMetadata
impl<'de> Deserialize<'de> for ContentMetadata
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 ContentMetadata
Source§impl Hash for ContentMetadata
impl Hash for ContentMetadata
Source§impl JsonSchema for ContentMetadata
impl JsonSchema for ContentMetadata
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 ContentMetadata
impl PartialEq for ContentMetadata
Source§impl Serialize for ContentMetadata
impl Serialize for ContentMetadata
impl StructuralPartialEq for ContentMetadata
Auto Trait Implementations§
impl Forget for ContentMetadata
impl Freeze for ContentMetadata
impl Move for ContentMetadata
impl RefUnwindSafe for ContentMetadata
impl Send for ContentMetadata
impl Sync for ContentMetadata
impl Unpin for ContentMetadata
impl UnsafeUnpin for ContentMetadata
impl UnwindSafe for ContentMetadata
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