pub struct RegoPolicyClientBuilder { /* private fields */ }Expand description
Builder of a RegoPolicyClient.
Implementations§
Source§impl RegoPolicyClientBuilder
impl RegoPolicyClientBuilder
Sourcepub fn policy(self, name: impl Into<String>, source: impl Into<String>) -> Self
pub fn policy(self, name: impl Into<String>, source: impl Into<String>) -> Self
Adds a policy module; name labels it in error messages.
Sourcepub fn data(self, data: JsonValue) -> Self
pub fn data(self, data: JsonValue) -> Self
Adds a data document (merged into data with earlier documents).
Sourcepub fn build(self) -> Result<RegoPolicyClient, PolicyError>
pub fn build(self) -> Result<RegoPolicyClient, PolicyError>
Parses the policies and loads the data.
§Errors
Returns PolicyError::Engine when a policy does not parse or a data
document cannot be merged.
Trait Implementations§
Source§impl Debug for RegoPolicyClientBuilder
impl Debug for RegoPolicyClientBuilder
Source§impl Default for RegoPolicyClientBuilder
impl Default for RegoPolicyClientBuilder
Source§fn default() -> RegoPolicyClientBuilder
fn default() -> RegoPolicyClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RegoPolicyClientBuilder
impl RefUnwindSafe for RegoPolicyClientBuilder
impl Send for RegoPolicyClientBuilder
impl Sync for RegoPolicyClientBuilder
impl Unpin for RegoPolicyClientBuilder
impl UnsafeUnpin for RegoPolicyClientBuilder
impl UnwindSafe for RegoPolicyClientBuilder
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