[][src]Struct carapax_access::AccessRule

pub struct AccessRule { /* fields omitted */ }

An access rule - contains information about principal and grant

Methods

impl AccessRule[src]

pub fn new<P: Into<Principal>>(principal: P, is_granted: bool) -> Self[src]

Creates a new rule

pub fn allow<P: Into<Principal>>(principal: P) -> Self[src]

Creates a new rule with granted access

pub fn deny<P: Into<Principal>>(principal: P) -> Self[src]

Creates a new rule with forbidden access

pub fn allow_all() -> Self[src]

Creates a new rule with granted access for all

pub fn deny_all() -> Self[src]

Creates a new rule with forbidden access for all

pub fn allow_user<P: Into<PrincipalUser>>(principal: P) -> Self[src]

Creates a new rule with granted access for user

pub fn deny_user<P: Into<PrincipalUser>>(principal: P) -> Self[src]

Creates a new rule with forbidden access for user

pub fn allow_chat<P: Into<PrincipalChat>>(principal: P) -> Self[src]

Creates a new rule with granted access for chat

pub fn deny_chat<P: Into<PrincipalChat>>(principal: P) -> Self[src]

Creates a new rule with forbidden access for chat

pub fn allow_chat_user<C, U>(chat: C, user: U) -> Self where
    C: Into<PrincipalChat>,
    U: Into<PrincipalUser>, 
[src]

Creates a new rule with granted access for chat user

pub fn deny_chat_user<C, U>(chat: C, user: U) -> Self where
    C: Into<PrincipalChat>,
    U: Into<PrincipalUser>, 
[src]

Creates a new rule with forbidden access for chat user

pub fn accepts(&self, update: &Update) -> bool[src]

Whether rule accepts an update

pub fn is_granted(&self) -> bool[src]

Is access granted

Trait Implementations

impl Debug for AccessRule[src]

Auto Trait Implementations

impl Send for AccessRule

impl Sync for AccessRule

Blanket Implementations

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.

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

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

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

impl<T> Any for T where
    T: Any

impl<T> Erased for T