pub struct RedactPolicy {
pub blocked_topics: HashSet<String>,
pub allowed_topics: Vec<String>,
pub topic_redaction_level: HashMap<String, RedactionLevel>,
pub default_redaction_level: Option<RedactionLevel>,
}Fields§
§blocked_topics: HashSet<String>Topics that are hard-blocked — MCP returns an error, never runs the inspection.
allowed_topics: Vec<String>If non-empty, only these topics are allowed (whitelist mode). An empty vec means all topics are allowed (subject to blocked_topics).
topic_redaction_level: HashMap<String, RedactionLevel>Per-topic redaction level override. Values: “none” | “regex” | “semantic”
default_redaction_level: Option<RedactionLevel>Fallback level when no per-topic override exists. Defaults to “regex” when edge_redact is active, “none” otherwise.
Implementations§
Source§impl RedactPolicy
impl RedactPolicy
Sourcepub fn is_blocked(&self, topic: &str) -> bool
pub fn is_blocked(&self, topic: &str) -> bool
Check whether a topic is blocked by policy.
Sourcepub fn redaction_level(
&self,
topic: &str,
edge_redact_active: bool,
) -> RedactionLevel
pub fn redaction_level( &self, topic: &str, edge_redact_active: bool, ) -> RedactionLevel
Effective redaction level for a topic, given whether –edge-redact was passed.
Trait Implementations§
Source§impl Clone for RedactPolicy
impl Clone for RedactPolicy
Source§fn clone(&self) -> RedactPolicy
fn clone(&self) -> RedactPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RedactPolicy
impl Debug for RedactPolicy
Source§impl Default for RedactPolicy
impl Default for RedactPolicy
Source§fn default() -> RedactPolicy
fn default() -> RedactPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RedactPolicy
impl<'de> Deserialize<'de> for RedactPolicy
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
Auto Trait Implementations§
impl Freeze for RedactPolicy
impl RefUnwindSafe for RedactPolicy
impl Send for RedactPolicy
impl Sync for RedactPolicy
impl Unpin for RedactPolicy
impl UnsafeUnpin for RedactPolicy
impl UnwindSafe for RedactPolicy
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 more