pub enum Principal {
All,
User(UserId),
Chat(ChatId),
ChatUser(ChatId, UserId),
}
Available on crate feature
access
only.Expand description
Represents a principal entity that decides whether
an crate::access::AccessRule
should accept an update.
Variants§
All
Accepts all updates without any specific conditions.
User(UserId)
Accepts updates only from a specified user.
Chat(ChatId)
Accepts updates only from a specified chat.
ChatUser(ChatId, UserId)
Accepts updates only from a user within a specific chat.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Principal
impl<'de> Deserialize<'de> for Principal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Principal
Auto Trait Implementations§
impl Freeze for Principal
impl RefUnwindSafe for Principal
impl Send for Principal
impl Sync for Principal
impl Unpin for Principal
impl UnwindSafe for Principal
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