#[non_exhaustive]pub struct SanitizationResult {
pub filter_match_state: FilterMatchState,
pub filter_results: HashMap<String, FilterResult>,
pub invocation_result: InvocationResult,
pub sanitization_metadata: Option<SanitizationMetadata>,
/* private fields */
}Expand description
Sanitization result after applying all the filters on input content.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.filter_match_state: FilterMatchStateOutput only. Overall filter match state for Sanitization. The state can have below two values.
-
NO_MATCH_FOUND: No filters in configuration satisfy matching criteria. In other words, input passed all filters.
-
MATCH_FOUND: At least one filter in configuration satisfies matching. In other words, input did not pass one or more filters.
filter_results: HashMap<String, FilterResult>Output only. Results for all filters where the key is the filter name - either of “csam”, “malicious_uris”, “rai”, “pi_and_jailbreak” ,“sdp”.
invocation_result: InvocationResultOutput only. A field indicating the outcome of the invocation, irrespective of match status. It can have the following three values: SUCCESS: All filters were executed successfully. PARTIAL: Some filters were skipped or failed execution. FAILURE: All filters were skipped or failed execution.
sanitization_metadata: Option<SanitizationMetadata>Output only. Metadata related to Sanitization.
Implementations§
Source§impl SanitizationResult
impl SanitizationResult
pub fn new() -> Self
Sourcepub fn set_filter_match_state<T: Into<FilterMatchState>>(self, v: T) -> Self
pub fn set_filter_match_state<T: Into<FilterMatchState>>(self, v: T) -> Self
Sets the value of filter_match_state.
Sourcepub fn set_filter_results<T, K, V>(self, v: T) -> Self
pub fn set_filter_results<T, K, V>(self, v: T) -> Self
Sets the value of filter_results.
Sourcepub fn set_invocation_result<T: Into<InvocationResult>>(self, v: T) -> Self
pub fn set_invocation_result<T: Into<InvocationResult>>(self, v: T) -> Self
Sets the value of invocation_result.
Sourcepub fn set_sanitization_metadata<T>(self, v: T) -> Selfwhere
T: Into<SanitizationMetadata>,
pub fn set_sanitization_metadata<T>(self, v: T) -> Selfwhere
T: Into<SanitizationMetadata>,
Sets the value of sanitization_metadata.
Sourcepub fn set_or_clear_sanitization_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<SanitizationMetadata>,
pub fn set_or_clear_sanitization_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<SanitizationMetadata>,
Sets or clears the value of sanitization_metadata.
Trait Implementations§
Source§impl Clone for SanitizationResult
impl Clone for SanitizationResult
Source§fn clone(&self) -> SanitizationResult
fn clone(&self) -> SanitizationResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more