pub struct RedactionPolicy {
pub deny: Vec<RedactionRule>,
pub allow: Option<Vec<String>>,
pub default_replacement: String,
}Expand description
JSON Pointer redaction policy for tool results.
Fields§
§deny: Vec<RedactionRule>Pointers redacted before size bounding.
allow: Option<Vec<String>>Optional allow-list. Values outside these pointers are redacted while ancestor containers are retained so allowed descendants can survive.
default_replacement: StringDefault replacement used when a rule does not specify one.
Implementations§
Source§impl RedactionPolicy
impl RedactionPolicy
Sourcepub fn deny_pointers<I, S>(pointers: I) -> Self
pub fn deny_pointers<I, S>(pointers: I) -> Self
Create a deny-list policy from JSON Pointers.
Sourcepub fn allow_pointers<I, S>(pointers: I) -> Self
pub fn allow_pointers<I, S>(pointers: I) -> Self
Create an allow-list policy from JSON Pointers.
Sourcepub fn with_default_replacement(self, replacement: impl Into<String>) -> Self
pub fn with_default_replacement(self, replacement: impl Into<String>) -> Self
Set the default replacement string.
Trait Implementations§
Source§impl Clone for RedactionPolicy
impl Clone for RedactionPolicy
Source§fn clone(&self) -> RedactionPolicy
fn clone(&self) -> RedactionPolicy
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 RedactionPolicy
impl Debug for RedactionPolicy
Source§impl<'de> Deserialize<'de> for RedactionPolicy
impl<'de> Deserialize<'de> for RedactionPolicy
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
Source§impl PartialEq for RedactionPolicy
impl PartialEq for RedactionPolicy
Source§fn eq(&self, other: &RedactionPolicy) -> bool
fn eq(&self, other: &RedactionPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RedactionPolicy
impl Serialize for RedactionPolicy
impl Eq for RedactionPolicy
impl StructuralPartialEq for RedactionPolicy
Auto Trait Implementations§
impl Freeze for RedactionPolicy
impl RefUnwindSafe for RedactionPolicy
impl Send for RedactionPolicy
impl Sync for RedactionPolicy
impl Unpin for RedactionPolicy
impl UnsafeUnpin for RedactionPolicy
impl UnwindSafe for RedactionPolicy
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