pub struct RegoPolicyClient { /* private fields */ }Expand description
Evaluates Rego policies in-process.
Policies and data documents are loaded once through the builder; every
evaluation clones the prepared engine, sets the input and evaluates the
rule data.<path>. An undefined rule value yields JsonValue::Null
(not applicable); a rule path that does not exist is an
PolicyError::Engine error, which approval policies treat as a
denial.
Implementations§
Source§impl RegoPolicyClient
impl RegoPolicyClient
Sourcepub fn builder() -> RegoPolicyClientBuilder
pub fn builder() -> RegoPolicyClientBuilder
Starts building a client.
Sourcepub fn from_policy(
name: impl Into<String>,
source: impl Into<String>,
) -> Result<Self, PolicyError>
pub fn from_policy( name: impl Into<String>, source: impl Into<String>, ) -> Result<Self, PolicyError>
Creates a client from a single policy module.
§Errors
Returns PolicyError::Engine when the policy does not parse.
Trait Implementations§
Source§impl Debug for RegoPolicyClient
impl Debug for RegoPolicyClient
Source§impl PolicyClient for RegoPolicyClient
impl PolicyClient for RegoPolicyClient
Auto Trait Implementations§
impl !RefUnwindSafe for RegoPolicyClient
impl !UnwindSafe for RegoPolicyClient
impl Freeze for RegoPolicyClient
impl Send for RegoPolicyClient
impl Sync for RegoPolicyClient
impl Unpin for RegoPolicyClient
impl UnsafeUnpin for RegoPolicyClient
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