[][src]Enum carapax_access::Principal

pub enum Principal {
    All,
    User(PrincipalUser),
    Chat(PrincipalChat),
    ChatUser(PrincipalChatPrincipalUser),
}

Principal helps to decide should rule accept an update or not

Variants

All

Accepts all updates

User(PrincipalUser)

Accepts updates only from a specified user

Chat(PrincipalChat)

Accepts updates only from a specified chat

ChatUser(PrincipalChatPrincipalUser)

Accepts updates only from a user in chat

Methods

impl Principal[src]

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

Creates a principal for user

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

Creates a principal for chat

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

Creates a principal for chat user

Trait Implementations

impl PartialEq<Principal> for Principal[src]

impl Clone for Principal[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<PrincipalUser> for Principal[src]

impl From<PrincipalChat> for Principal[src]

impl From<(PrincipalChat, PrincipalUser)> for Principal[src]

impl Debug for Principal[src]

Auto Trait Implementations

impl Send for Principal

impl Sync for Principal

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> CloneAny for T where
    T: Clone + Any