pub struct PIIStorageHook { /* private fields */ }Expand description
PII Storage Hook for pre-storage processing
Implementations§
Source§impl PIIStorageHook
impl PIIStorageHook
Sourcepub fn new(config: PIIStorageConfig) -> Self
pub fn new(config: PIIStorageConfig) -> Self
Create a new PII storage hook
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create with default configuration
Sourcepub fn for_legal_office() -> Self
pub fn for_legal_office() -> Self
Create for law office use
Sourcepub fn analyze_for_storage(&self, text: &str) -> PIIDetectionResult
pub fn analyze_for_storage(&self, text: &str) -> PIIDetectionResult
Pre-storage hook: Analyze text before storage
This performs PII detection and returns metadata about the content. The caller can use this to decide how to store the data.
Sourcepub fn prepare_for_storage(
&self,
text: &str,
encryption_key: Option<&str>,
) -> Result<(String, String, PIIDetectionResult)>
pub fn prepare_for_storage( &self, text: &str, encryption_key: Option<&str>, ) -> Result<(String, String, PIIDetectionResult)>
Prepare data for dual storage
Returns (encrypted_original, redacted_version)
Sourcepub fn should_allow_storage(&self, detection: &PIIDetectionResult) -> bool
pub fn should_allow_storage(&self, detection: &PIIDetectionResult) -> bool
Check if storage should be allowed based on detection result
Sourcepub fn get_access_level(
&self,
user_role: &str,
detection: &PIIDetectionResult,
) -> AccessLevel
pub fn get_access_level( &self, user_role: &str, detection: &PIIDetectionResult, ) -> AccessLevel
Get the access level for a user based on their role
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PIIStorageHook
impl RefUnwindSafe for PIIStorageHook
impl Send for PIIStorageHook
impl Sync for PIIStorageHook
impl Unpin for PIIStorageHook
impl UnwindSafe for PIIStorageHook
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> 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