pub struct PolicyBuilder<V, M, S> { /* private fields */ }Expand description
Implementations§
Source§impl PolicyBuilder<DefaultValidator, Default, DefaultSubstituter>
impl PolicyBuilder<DefaultValidator, Default, DefaultSubstituter>
Sourcepub fn from_json(
json: impl Into<String>,
) -> PolicyBuilder<DefaultValidator, Default, DefaultSubstituter>
pub fn from_json( json: impl Into<String>, ) -> PolicyBuilder<DefaultValidator, Default, DefaultSubstituter>
Constructs a PolicyBuilder from provided json policy definition, with
default configuration.
Call to this method does not parse or validate the json, all heavy work
is done in build method.
Sourcepub fn from_definition(
definition: PolicyDefinition,
) -> PolicyBuilder<DefaultValidator, Default, DefaultSubstituter>
pub fn from_definition( definition: PolicyDefinition, ) -> PolicyBuilder<DefaultValidator, Default, DefaultSubstituter>
Constructs a PolicyBuilder from provided policy definition struct, with
default configuration.
Call to this method does not validate the definition, all heavy work
is done in build method.
Source§impl<V, M, S, E> PolicyBuilder<V, M, S>where
V: PolicyValidator<Error = E>,
M: ResourceMatcher,
S: Substituter,
E: StdError + Sync + Into<Box<dyn StdError>> + 'static,
impl<V, M, S, E> PolicyBuilder<V, M, S>where
V: PolicyValidator<Error = E>,
M: ResourceMatcher,
S: Substituter,
E: StdError + Sync + Into<Box<dyn StdError>> + 'static,
Sourcepub fn with_validator<V1>(self, validator: V1) -> PolicyBuilder<V1, M, S>
pub fn with_validator<V1>(self, validator: V1) -> PolicyBuilder<V1, M, S>
Specifies the PolicyValidator to validate the policy definition.
Sourcepub fn with_matcher<M1>(self, matcher: M1) -> PolicyBuilder<V, M1, S>
pub fn with_matcher<M1>(self, matcher: M1) -> PolicyBuilder<V, M1, S>
Specifies the ResourceMatcher to use with Policy.
Sourcepub fn with_substituter<S1>(self, substituter: S1) -> PolicyBuilder<V, M, S1>
pub fn with_substituter<S1>(self, substituter: S1) -> PolicyBuilder<V, M, S1>
Specifies the Substituter to use with Policy.
Sourcepub fn with_default_decision(self, decision: Decision) -> Self
pub fn with_default_decision(self, decision: Decision) -> Self
Specifies the default decision that Policy will return if
no rules match the request.
Auto Trait Implementations§
impl<V, M, S> Freeze for PolicyBuilder<V, M, S>
impl<V, M, S> RefUnwindSafe for PolicyBuilder<V, M, S>
impl<V, M, S> Send for PolicyBuilder<V, M, S>
impl<V, M, S> Sync for PolicyBuilder<V, M, S>
impl<V, M, S> Unpin for PolicyBuilder<V, M, S>
impl<V, M, S> UnwindSafe for PolicyBuilder<V, M, S>
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