ChatBuilder

Struct ChatBuilder 

Source
pub struct ChatBuilder { /* private fields */ }
Expand description

Builder for the Chat structure

Implementations§

Source§

impl ChatBuilder

Source

pub fn new(id: i64, _type: ChatType) -> Self

Instantiate the builder with the fields id, _type, title, username, first_name, last_name, is_forum, photo, active_usernames, emoji_status_custom_emoji_id, bio, has_private_forwards, has_restricted_voice_and_video_messages, join_to_send_messages, join_by_request, description, invite_link, pinned_message, permissions, slow_mode_delay, message_auto_delete_time, has_aggressive_anti_spam_enabled, has_hidden_members, has_protected_content, sticker_set_name, can_set_sticker_set, linked_chat_id, location

Source

pub fn title(self, val: String) -> Self

Set the field title to the given value

Source

pub fn username(self, val: String) -> Self

Set the field username to the given value

Source

pub fn first_name(self, val: String) -> Self

Set the field first_name to the given value

Source

pub fn last_name(self, val: String) -> Self

Set the field last_name to the given value

Source

pub fn is_forum(self, val: bool) -> Self

Set the field is_forum to the given value

Source

pub fn photo(self, val: ChatPhoto) -> Self

Set the field photo to the given value

Source

pub fn active_usernames(self, val: Vec<String>) -> Self

Set the field active_usernames to the given value

Source

pub fn emoji_status_custom_emoji_id(self, val: String) -> Self

Set the field emoji_status_custom_emoji_id to the given value

Source

pub fn bio(self, val: String) -> Self

Set the field bio to the given value

Source

pub fn has_private_forwards(self, val: bool) -> Self

Set the field has_private_forwards to the given value

Source

pub fn has_restricted_voice_and_video_messages(self, val: bool) -> Self

Set the field has_restricted_voice_and_video_messages to the given value

Source

pub fn join_to_send_messages(self, val: bool) -> Self

Set the field join_to_send_messages to the given value

Source

pub fn join_by_request(self, val: bool) -> Self

Set the field join_by_request to the given value

Source

pub fn description(self, val: String) -> Self

Set the field description to the given value

Set the field invite_link to the given value

Source

pub fn pinned_message(self, val: Box<Message>) -> Self

Set the field pinned_message to the given value

Source

pub fn permissions(self, val: ChatPermissions) -> Self

Set the field permissions to the given value

Source

pub fn slow_mode_delay(self, val: i64) -> Self

Set the field slow_mode_delay to the given value

Source

pub fn message_auto_delete_time(self, val: i64) -> Self

Set the field message_auto_delete_time to the given value

Source

pub fn has_aggressive_anti_spam_enabled(self, val: bool) -> Self

Set the field has_aggressive_anti_spam_enabled to the given value

Source

pub fn has_hidden_members(self, val: bool) -> Self

Set the field has_hidden_members to the given value

Source

pub fn has_protected_content(self, val: bool) -> Self

Set the field has_protected_content to the given value

Source

pub fn sticker_set_name(self, val: String) -> Self

Set the field sticker_set_name to the given value

Source

pub fn can_set_sticker_set(self, val: bool) -> Self

Set the field can_set_sticker_set to the given value

Source

pub fn linked_chat_id(self, val: i64) -> Self

Set the field linked_chat_id to the given value

Source

pub fn location(self, val: ChatLocation) -> Self

Set the field location to the given value

Trait Implementations§

Source§

impl Builder for ChatBuilder

Source§

type Value = Chat

Type to be built
Source§

fn build(self) -> <ChatBuilder as Builder>::Value

Converts the builder into the built value

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
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> ErasedDestructor for T
where T: 'static,