Skip to main content

is_policy_string

Function
This function is defined in the parse_utils module.
Check if a string is a policy specification. O(1) operation. Policy strings have format: type:action (e.g., “policy:strict”, “pii:redact”)

Signature

def is_policy_string(value: &str) -> bool

Parameters

value
&str
required
No description available.

Returns

Returns
bool
The result of the operation.

Usage

use praisonai::parity::parse_utils::is_policy_string;

assert!(is_policy_string("policy:strict"));
assert!(is_policy_string("pii:redact"));
assert!(!is_policy_string("strict"));

Uses

  • contains
  • splitn
  • identifier

Source

View on GitHub

praisonai/src/parity/parse_utils.rs at line 110