[][src]Struct allow_me::Policy

pub struct Policy<R, S> { /* fields omitted */ }

Policy engine. Represents a read-only set of rules and can evaluate Request based on those rules.

Policy engine consists of two sets:

  • static rules
  • variable rules - any rule that contains variables ("{{..}}"). Static rules are organized in a data structure with fast querying time. Variable rules are evaluated on every request.

Implementations

impl<R, S, RC> Policy<R, S> where
    R: ResourceMatcher<Context = RC>,
    S: Substituter<Context = RC>, 
[src]

pub fn evaluate(&self, request: &Request<RC>) -> Result<Decision>[src]

Evaluates the provided Request and produces the Decision.

If no rules match the Request - the default Decision is returned.

Trait Implementations

impl<R: Debug, S: Debug> Debug for Policy<R, S>[src]

Auto Trait Implementations

impl<R, S> RefUnwindSafe for Policy<R, S> where
    R: RefUnwindSafe,
    S: RefUnwindSafe
[src]

impl<R, S> Send for Policy<R, S> where
    R: Send,
    S: Send
[src]

impl<R, S> Sync for Policy<R, S> where
    R: Sync,
    S: Sync
[src]

impl<R, S> Unpin for Policy<R, S> where
    R: Unpin,
    S: Unpin
[src]

impl<R, S> UnwindSafe for Policy<R, S> where
    R: UnwindSafe,
    S: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.