[−][src]Struct carapax::access::AccessRule
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]
C: Into<PrincipalChat>,
U: Into<PrincipalUser>,
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]
C: Into<PrincipalChat>,
U: Into<PrincipalUser>,
Creates a new rule with forbidden access for chat user
pub fn accepts(&self, update: &Update) -> bool
[src]
Whether rule accepts an update
Trait Implementations
Auto Trait Implementations
impl Send for AccessRule
impl Sync for AccessRule
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,