pub struct ChatMemberAdministrator { /* private fields */ }
Expand description

Represents a chat member that has some additional privileges.

Implementations§

source§

impl ChatMemberAdministrator

source§

impl ChatMemberAdministrator

source

pub fn new( user: User, can_be_edited: bool, is_anonymous: bool, can_manage_chat: bool, can_delete_messages: bool, can_manage_video_chats: bool, can_restrict_members: bool, can_promote_members: bool, can_change_info: bool, can_invite_users: bool ) -> Self

source

pub fn into_tuple( self ) -> (User, bool, bool, bool, bool, bool, bool, bool, bool, bool, Option<bool>, Option<bool>, Option<bool>, Option<bool>, Option<bool>, Option<bool>, Option<bool>, Option<String>)

Consumes and deconstructs this type into a tuple with one element per field. Tuple type returned is: (user, can_be_edited, is_anonymous, can_manage_chat, can_delete_messages, can_manage_video_chats, can_restrict_members, can_promote_members, can_change_info, can_invite_users, can_post_messages, can_edit_messages, can_pin_messages, can_post_stories, can_edit_stories, can_delete_stories, can_manage_topics, custom_title)

source

pub fn get_user<'a>(&'a self) -> Cow<'a, User>

Information about the user

source

pub fn get_user_ref<'a>(&'a self) -> &'a User

Information about the user

source

pub fn set_user<'a>(&'a mut self, user: User) -> &'a mut Self

Information about the user

source

pub fn get_can_be_edited<'a>(&'a self) -> bool

True, if the bot is allowed to edit administrator privileges of that user

source

pub fn get_can_be_edited_ref<'a>(&'a self) -> bool

True, if the bot is allowed to edit administrator privileges of that user

source

pub fn set_can_be_edited<'a>(&'a mut self, can_be_edited: bool) -> &'a mut Self

True, if the bot is allowed to edit administrator privileges of that user

source

pub fn get_is_anonymous<'a>(&'a self) -> bool

True, if the user’s presence in the chat is hidden

source

pub fn get_is_anonymous_ref<'a>(&'a self) -> bool

True, if the user’s presence in the chat is hidden

source

pub fn set_is_anonymous<'a>(&'a mut self, is_anonymous: bool) -> &'a mut Self

True, if the user’s presence in the chat is hidden

source

pub fn get_can_manage_chat<'a>(&'a self) -> bool

True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

source

pub fn get_can_manage_chat_ref<'a>(&'a self) -> bool

True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

source

pub fn set_can_manage_chat<'a>( &'a mut self, can_manage_chat: bool ) -> &'a mut Self

True, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

source

pub fn get_can_delete_messages<'a>(&'a self) -> bool

True, if the administrator can delete messages of other users

source

pub fn get_can_delete_messages_ref<'a>(&'a self) -> bool

True, if the administrator can delete messages of other users

source

pub fn set_can_delete_messages<'a>( &'a mut self, can_delete_messages: bool ) -> &'a mut Self

True, if the administrator can delete messages of other users

source

pub fn get_can_manage_video_chats<'a>(&'a self) -> bool

True, if the administrator can manage video chats

source

pub fn get_can_manage_video_chats_ref<'a>(&'a self) -> bool

True, if the administrator can manage video chats

source

pub fn set_can_manage_video_chats<'a>( &'a mut self, can_manage_video_chats: bool ) -> &'a mut Self

True, if the administrator can manage video chats

source

pub fn get_can_restrict_members<'a>(&'a self) -> bool

True, if the administrator can restrict, ban or unban chat members

source

pub fn get_can_restrict_members_ref<'a>(&'a self) -> bool

True, if the administrator can restrict, ban or unban chat members

source

pub fn set_can_restrict_members<'a>( &'a mut self, can_restrict_members: bool ) -> &'a mut Self

True, if the administrator can restrict, ban or unban chat members

source

pub fn get_can_promote_members<'a>(&'a self) -> bool

True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)

source

pub fn get_can_promote_members_ref<'a>(&'a self) -> bool

True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)

source

pub fn set_can_promote_members<'a>( &'a mut self, can_promote_members: bool ) -> &'a mut Self

True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)

source

pub fn get_can_change_info<'a>(&'a self) -> bool

True, if the user is allowed to change the chat title, photo and other settings

source

pub fn get_can_change_info_ref<'a>(&'a self) -> bool

True, if the user is allowed to change the chat title, photo and other settings

source

pub fn set_can_change_info<'a>( &'a mut self, can_change_info: bool ) -> &'a mut Self

True, if the user is allowed to change the chat title, photo and other settings

source

pub fn get_can_invite_users<'a>(&'a self) -> bool

True, if the user is allowed to invite new users to the chat

source

pub fn get_can_invite_users_ref<'a>(&'a self) -> bool

True, if the user is allowed to invite new users to the chat

source

pub fn set_can_invite_users<'a>( &'a mut self, can_invite_users: bool ) -> &'a mut Self

True, if the user is allowed to invite new users to the chat

source

pub fn get_can_post_messages<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can post messages in the channel; channels only

source

pub fn get_can_post_messages_ref<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can post messages in the channel; channels only

source

pub fn set_can_post_messages<'a>( &'a mut self, can_post_messages: Option<bool> ) -> &'a mut Self

Optional. True, if the administrator can post messages in the channel; channels only

source

pub fn get_can_edit_messages<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can edit messages of other users and can pin messages; channels only

source

pub fn get_can_edit_messages_ref<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can edit messages of other users and can pin messages; channels only

source

pub fn set_can_edit_messages<'a>( &'a mut self, can_edit_messages: Option<bool> ) -> &'a mut Self

Optional. True, if the administrator can edit messages of other users and can pin messages; channels only

source

pub fn get_can_pin_messages<'a>(&'a self) -> Option<bool>

Optional. True, if the user is allowed to pin messages; groups and supergroups only

source

pub fn get_can_pin_messages_ref<'a>(&'a self) -> Option<bool>

Optional. True, if the user is allowed to pin messages; groups and supergroups only

source

pub fn set_can_pin_messages<'a>( &'a mut self, can_pin_messages: Option<bool> ) -> &'a mut Self

Optional. True, if the user is allowed to pin messages; groups and supergroups only

source

pub fn get_can_post_stories<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can post stories in the channel; channels only

source

pub fn get_can_post_stories_ref<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can post stories in the channel; channels only

source

pub fn set_can_post_stories<'a>( &'a mut self, can_post_stories: Option<bool> ) -> &'a mut Self

Optional. True, if the administrator can post stories in the channel; channels only

source

pub fn get_can_edit_stories<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can edit stories posted by other users; channels only

source

pub fn get_can_edit_stories_ref<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can edit stories posted by other users; channels only

source

pub fn set_can_edit_stories<'a>( &'a mut self, can_edit_stories: Option<bool> ) -> &'a mut Self

Optional. True, if the administrator can edit stories posted by other users; channels only

source

pub fn get_can_delete_stories<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can delete stories posted by other users; channels only

source

pub fn get_can_delete_stories_ref<'a>(&'a self) -> Option<bool>

Optional. True, if the administrator can delete stories posted by other users; channels only

source

pub fn set_can_delete_stories<'a>( &'a mut self, can_delete_stories: Option<bool> ) -> &'a mut Self

Optional. True, if the administrator can delete stories posted by other users; channels only

source

pub fn get_can_manage_topics<'a>(&'a self) -> Option<bool>

Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

source

pub fn get_can_manage_topics_ref<'a>(&'a self) -> Option<bool>

Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

source

pub fn set_can_manage_topics<'a>( &'a mut self, can_manage_topics: Option<bool> ) -> &'a mut Self

Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

source

pub fn get_custom_title<'a>(&'a self) -> Option<Cow<'a, str>>

Optional. Custom title for this user

source

pub fn get_custom_title_ref<'a>(&'a self) -> Option<&'a str>

Optional. Custom title for this user

source

pub fn set_custom_title<'a>( &'a mut self, custom_title: Option<String> ) -> &'a mut Self

Optional. Custom title for this user

Trait Implementations§

source§

impl Clone for ChatMemberAdministrator

source§

fn clone(&self) -> ChatMemberAdministrator

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChatMemberAdministrator

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ChatMemberAdministrator

source§

fn default() -> ChatMemberAdministrator

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ChatMemberAdministrator

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NoSkipChatMemberAdministrator> for ChatMemberAdministrator

source§

fn from(t: NoSkipChatMemberAdministrator) -> Self

Converts to this type from the input type.
source§

impl Into<NoSkipChatMemberAdministrator> for ChatMemberAdministrator

source§

fn into(self) -> NoSkipChatMemberAdministrator

Converts this type into the (usually inferred) input type.
source§

impl Serialize for ChatMemberAdministrator

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,