#[non_exhaustive]pub struct Permissions {
pub can_send_messages: Option<bool>,
pub can_send_media_messages: Option<bool>,
pub can_send_polls: Option<bool>,
pub can_send_other_messages: Option<bool>,
pub can_add_web_page_previews: Option<bool>,
pub can_change_info: Option<bool>,
pub can_invite_users: Option<bool>,
pub can_pin_messages: Option<bool>,
}Expand description
Describes actions that a non-administrator user is allowed to take in a chat.
This struct is a representation of ChatPermissions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.can_send_messages: Option<bool>true if the user can send text messages, contacts, locations and
venues.
can_send_media_messages: Option<bool>true if the user can send audios, documents, photos, videos, video
notes and voice notes. Implies can_send_messages.
can_send_polls: Option<bool>true if the user can send polls. Implies can_send_messages.
can_send_other_messages: Option<bool>true if the user can use inline bots and send animations, games and
stickers. Implies can_send_media_messages.
can_add_web_page_previews: Option<bool>true if the user can add web page previews. Implies
can_send_media_messages.
can_change_info: Option<bool>true if the user can change the chat information. Ignored in public
supergroups.
can_invite_users: Option<bool>true if the user can invite new users.
can_pin_messages: Option<bool>true is the user can pin messages. Ignored in public supegroups.
Implementations§
Source§impl Permissions
impl Permissions
Sourcepub fn can_send_messages(self, can_send: bool) -> Self
pub fn can_send_messages(self, can_send: bool) -> Self
Configures if the user can send messages.
Sourcepub fn can_send_media_messages(self, can_send: bool) -> Self
pub fn can_send_media_messages(self, can_send: bool) -> Self
Configures if the user can send media messages.
Sourcepub fn can_send_polls(self, can_send: bool) -> Self
pub fn can_send_polls(self, can_send: bool) -> Self
Configures if the user can send polls.
Sourcepub fn can_send_other_messages(self, can_send: bool) -> Self
pub fn can_send_other_messages(self, can_send: bool) -> Self
Configures if the user can send other messages not covered by other permissions.
Sourcepub fn can_add_web_page_previews(self, can_add: bool) -> Self
pub fn can_add_web_page_previews(self, can_add: bool) -> Self
Configures if the user can add webpage previews.
Sourcepub fn can_change_info(self, can_change: bool) -> Self
pub fn can_change_info(self, can_change: bool) -> Self
Configures if the user can change chat information.
Sourcepub fn can_invite_users(self, can_invite: bool) -> Self
pub fn can_invite_users(self, can_invite: bool) -> Self
Configures if the user can invite new users to the chat.
Sourcepub fn can_pin_messages(self, can_pin: bool) -> Self
pub fn can_pin_messages(self, can_pin: bool) -> Self
Configures if the user can pin messages.
Trait Implementations§
Source§impl Clone for Permissions
impl Clone for Permissions
Source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Permissions
impl Debug for Permissions
Source§impl Default for Permissions
impl Default for Permissions
Source§fn default() -> Permissions
fn default() -> Permissions
Source§impl<'de> Deserialize<'de> for Permissions
impl<'de> Deserialize<'de> for Permissions
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>,
Source§impl Hash for Permissions
impl Hash for Permissions
Source§impl PartialEq for Permissions
impl PartialEq for Permissions
Source§impl Serialize for Permissions
impl Serialize for Permissions
impl Copy for Permissions
impl Eq for Permissions
impl StructuralPartialEq for Permissions
Auto Trait Implementations§
impl Freeze for Permissions
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnwindSafe for Permissions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.