pub struct ContentSource {
pub kind: ContentSourceKind,
pub trust_level: TrustLevel,
pub identifier: Option<String>,
pub memory_hint: Option<MemorySourceHint>,
}Expand description
Provenance metadata attached to a piece of untrusted content.
Fields§
§kind: ContentSourceKind§trust_level: TrustLevel§identifier: Option<String>Optional identifier: tool name, URL, agent ID, etc.
memory_hint: Option<MemorySourceHint>Optional hint for memory retrieval sub-sources. When Some, modulates injection
detection sensitivity in ContentSanitizer::sanitize. Non-memory sources leave
this as None — full detection applies.
Implementations§
Source§impl ContentSource
impl ContentSource
pub fn new(kind: ContentSourceKind) -> ContentSource
pub fn with_identifier(self, id: impl Into<String>) -> ContentSource
pub fn with_trust_level(self, level: TrustLevel) -> ContentSource
Sourcepub fn with_memory_hint(self, hint: MemorySourceHint) -> ContentSource
pub fn with_memory_hint(self, hint: MemorySourceHint) -> ContentSource
Attach a memory source hint to modulate injection detection sensitivity.
Only meaningful for ContentSourceKind::MemoryRetrieval sources.
Trait Implementations§
Source§impl Clone for ContentSource
impl Clone for ContentSource
Source§fn clone(&self) -> ContentSource
fn clone(&self) -> ContentSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContentSource
impl RefUnwindSafe for ContentSource
impl Send for ContentSource
impl Sync for ContentSource
impl Unpin for ContentSource
impl UnsafeUnpin for ContentSource
impl UnwindSafe for ContentSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request