Is Policy String • Rust AI Agent SDK

is_policy_string: Check if a string is a policy specification. O(1) operation. Policy strings have format: type:action (e.g., 'policy:strict', 'pii:redact')

is_policy_string

Function

</div>

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

python
def is_policy_string(value: &str) -> bool

Parameters

ParamField &str

No description available.

Returns

ResponseField bool

The result of the operation.

Usage

python
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


Related Documentation