Skip to main content

SendMessageBuilder

Struct SendMessageBuilder 

Source
pub struct SendMessageBuilder<'a> { /* private fields */ }
Expand description

Builder for the [sendMessage] API method.

Implementations§

Source§

impl<'a> SendMessageBuilder<'a>

Source

pub fn parse_mode(self, val: impl Into<String>) -> Self

Sets the parse_mode parameter.

Source

pub fn entities(self, val: Vec<MessageEntity>) -> Self

Sets the entities parameter.

Sets the link_preview_options parameter.

Source

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

Sets the disable_notification parameter.

Source

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

Sets the protect_content parameter.

Source

pub fn reply_parameters(self, val: ReplyParameters) -> Self

Sets the reply_parameters parameter.

Source

pub fn reply_markup(self, val: Value) -> Self

Sets the reply_markup parameter.

Source

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

Sets the message_thread_id parameter.

Source

pub fn business_connection_id(self, val: impl Into<String>) -> Self

Sets the business_connection_id parameter.

Source

pub fn message_effect_id(self, val: impl Into<String>) -> Self

Sets the message_effect_id parameter.

Source

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

Sets the allow_paid_broadcast parameter.

Source

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

Sets the direct_messages_topic_id parameter.

Source

pub fn suggested_post_parameters(self, val: SuggestedPostParameters) -> Self

Sets the suggested_post_parameters parameter.

Source

pub async fn send(self) -> Result<Message>

Sends the request to the Telegram Bot API.

Trait Implementations§

Source§

impl<'a> IntoFuture for SendMessageBuilder<'a>

Source§

type Output = Result<Message, TelegramError>

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = <SendMessageBuilder<'a> as IntoFuture>::Output> + Send + 'a>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more
Source§

impl<'a> Serialize for SendMessageBuilder<'a>

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 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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