#[non_exhaustive]pub struct SafetyNetContext<'a> {
pub dictionaries: Option<&'a DictionaryBundle>,
pub manifest: &'a Manifest,
pub locale_chain: &'a [LocaleTag],
pub document_kind: DocumentKind,
pub session_id: Option<&'a str>,
pub field_path: Option<&'a str>,
}Expand description
Context passed to a privacy safety net.
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.dictionaries: Option<&'a DictionaryBundle>Optional caller-supplied dictionaries. new leaves this unset; pipeline
wrappers supply the caller bundle or Some(empty default). Locale-aware
model backends have their separate text/locale interface without dictionaries.
manifest: &'a ManifestTokens emitted by the pipeline or verified as owned at a strict boundary. At that boundary, raw spans use expanded-owner input coordinates, not offsets into the literal token-bearing input. Do not index that literal input with reconstructed raw spans.
locale_chain: &'a [LocaleTag]Active session-level locale chain. For RawDocument::Structured, locale
gating uses this same session-level chain across all fields; structured
fields do not carry per-field locale annotations.
document_kind: DocumentKindSource document kind being checked.
session_id: Option<&'a str>Optional audit session identifier.
field_path: Option<&'a str>Structured-document field path, such as $.user.email.
Implementations§
Source§impl<'a> SafetyNetContext<'a>
impl<'a> SafetyNetContext<'a>
Sourcepub fn with_dictionaries(self, dictionaries: &'a DictionaryBundle) -> Self
pub fn with_dictionaries(self, dictionaries: &'a DictionaryBundle) -> Self
Supplies the same dictionary bundle used by primary detection.
Trait Implementations§
Source§impl<'a> Clone for SafetyNetContext<'a>
impl<'a> Clone for SafetyNetContext<'a>
Source§fn clone(&self) -> SafetyNetContext<'a>
fn clone(&self) -> SafetyNetContext<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for SafetyNetContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for SafetyNetContext<'a>
impl<'a> RefUnwindSafe for SafetyNetContext<'a>
impl<'a> Send for SafetyNetContext<'a>
impl<'a> Sync for SafetyNetContext<'a>
impl<'a> Unpin for SafetyNetContext<'a>
impl<'a> UnsafeUnpin for SafetyNetContext<'a>
impl<'a> UnwindSafe for SafetyNetContext<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 more