pub struct RedactionResult {
pub findings: Vec<Finding>,
pub redacted_text: String,
pub risk_signals: RiskSignals,
}Expand description
scan_text 的综合输出。
与 v0.3 (Value, String) 的 redact 返值不同:本 API 面向 Stage 2 文本扫描
场景(firewall preflight / browser classifier / CLI scan),返回结构化 findings
供 caller 按需拼 UI / 累加 risk。
Fields§
§findings: Vec<Finding>合并后的 findings,按 span.start 升序(继承 merge_findings 不变量)。
元素类型是 ISS-013 的 Finding,source 字段可区分 Hard / Model。
redacted_text: String原文按 findings 的 span 全部替换为 [REDACTED <label>] 后的脱敏文本。
替换策略:
PrivacyLabel::from_kind命中 →[REDACTED <label.as_str()>](稳定外部契约)- 未命中 →
[REDACTED <raw_kind>](兼容未来新 kind,不阻塞实装)
risk_signals: RiskSignals聚合风险信号,供 caller 快速判定“是否有 secret“/“总风险分”。
Trait Implementations§
Source§impl Clone for RedactionResult
impl Clone for RedactionResult
Source§fn clone(&self) -> RedactionResult
fn clone(&self) -> RedactionResult
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 RedactionResult
impl Debug for RedactionResult
Source§impl PartialEq for RedactionResult
impl PartialEq for RedactionResult
Source§fn eq(&self, other: &RedactionResult) -> bool
fn eq(&self, other: &RedactionResult) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RedactionResult
Auto Trait Implementations§
impl Freeze for RedactionResult
impl RefUnwindSafe for RedactionResult
impl Send for RedactionResult
impl Sync for RedactionResult
impl Unpin for RedactionResult
impl UnsafeUnpin for RedactionResult
impl UnwindSafe for RedactionResult
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