Parse Policy String • Rust AI Agent SDK

parse_policy_string: Parse a policy string into type and action. O(1) operation.

parse_policy_string

Function

</div>

This function is defined in the parse_utils module.

Parse a policy string into type and action. O(1) operation.

Signature

python
def parse_policy_string(value: &str) -> (&str, &str)

Parameters

ParamField &str

No description available.

Returns

ResponseField (&str, &str)

The result of the operation.

Usage

python
use praisonai::parity::parse_utils::parse_policy_string;

assert_eq!(parse_policy_string("policy:strict"), ("policy", "strict"));
assert_eq!(parse_policy_string("pii:redact"), ("pii", "redact"));

Uses

  • split_once

Source

View on GitHub

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


Related Documentation