pub struct CompiledMasking { /* private fields */ }masking only.Expand description
A masking policy compiled and ready to apply to pages.
Implementations§
Source§impl CompiledMasking
impl CompiledMasking
Sourcepub fn compile(spec: &MaskingSpec) -> Result<Self, FaucetError>
pub fn compile(spec: &MaskingSpec) -> Result<Self, FaucetError>
Compile the full policy (every rule, ignoring applies_to). Use this
for library callers that don’t scope by destination.
Sourcepub fn compile_for_sink(
spec: &MaskingSpec,
sink_ids: &[&str],
) -> Result<Self, FaucetError>
pub fn compile_for_sink( spec: &MaskingSpec, sink_ids: &[&str], ) -> Result<Self, FaucetError>
Compile the policy scoped to one destination sink, identified by any of
sink_ids (typically its template name and its connector kind): rules
with a non-empty applies_to that names none of sink_ids are dropped.
Every rule is still validated (so a bad regex fails the load even if the
rule doesn’t apply to this sink).
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
true when no rule applies (e.g. every rule is scoped to other sinks).
The caller can skip attaching the pass entirely.
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Number of active (post-scoping) rules.
Sourcepub fn name_action_for(&self, column: &str) -> Option<&'static str>
pub fn name_action_for(&self, column: &str) -> Option<&'static str>
The action a name-based rule applies to the field at the dot-path
column, matched on the field itself or on any ancestor — the same
depth-first walk apply_masking performs, so a
container matched by name masks every leaf beneath it. A value-detector
rule declared before the name rule could fire on the leaf first with a
different action, so the action is then unknown (None).
Trait Implementations§
Source§impl Clone for CompiledMasking
impl Clone for CompiledMasking
Auto Trait Implementations§
impl Freeze for CompiledMasking
impl RefUnwindSafe for CompiledMasking
impl Send for CompiledMasking
impl Sync for CompiledMasking
impl Unpin for CompiledMasking
impl UnsafeUnpin for CompiledMasking
impl UnwindSafe for CompiledMasking
Blanket Implementations§
impl<T> Allocation for T
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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 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>
T in a tonic::Request