Skip to main content

InputRichBlock

Enum InputRichBlock 

Source
pub enum InputRichBlock {
Show 24 variants Paragraph { text: RichText, }, Heading { text: RichText, size: u8, }, Pre { text: RichText, language: Option<String>, }, Footer { text: RichText, }, Divider, MathematicalExpression { expression: String, }, Anchor { name: String, }, List { items: Vec<InputRichBlockListItem>, }, BlockQuotation { blocks: Vec<InputRichBlock>, credit: Option<RichText>, }, ExpandableBlockQuotation { text: RichText, credit: Option<RichText>, }, PullQuotation { text: RichText, credit: Option<RichText>, }, Collage { blocks: Vec<InputRichBlock>, caption: Option<RichBlockCaption>, }, Slideshow { blocks: Vec<InputRichBlock>, caption: Option<RichBlockCaption>, }, Table { cells: Vec<Vec<RichBlockTableCell>>, is_bordered: Option<bool>, is_striped: Option<bool>, is_compact: Option<bool>, caption: Option<RichText>, }, Details { summary: RichText, blocks: Vec<InputRichBlock>, is_open: Option<bool>, }, Map { location: Location, zoom: Option<u8>, width: Option<u32>, height: Option<u32>, caption: Option<RichBlockCaption>, }, Buttons { buttons: Vec<RichMessageButton>, align: Option<HorizontalAlign>, }, Animation { animation: InputMediaAnimation, caption: Option<RichBlockCaption>, }, Audio { audio: InputMediaAudio, caption: Option<RichBlockCaption>, }, Document { document: InputMediaDocument, caption: Option<RichBlockCaption>, }, Photo { photo: InputMediaPhoto, caption: Option<RichBlockCaption>, }, Video { video: InputMediaVideo, caption: Option<RichBlockCaption>, }, VoiceNote { voice_note: InputMediaVoiceNote, caption: Option<RichBlockCaption>, }, Thinking { text: RichText, },
}
Expand description

A block in a rich formatted message to be sent, tagged by the type field.

Variants§

§

Paragraph

A text paragraph (<p>).

Fields

§text: RichText

Text of the block.

§

Heading

A section heading (<h1>–<h6>).

Fields

§text: RichText

Text of the block.

§size: u8

Relative font size; 1-6, 1 is the largest.

§

Pre

A preformatted text block (<pre><code>).

Fields

§text: RichText

Text of the block.

§language: Option<String>

Optional. The programming language of the text.

§

Footer

A footer (<footer>).

Fields

§text: RichText

Text of the block.

§

Divider

A divider (<hr/>).

§

MathematicalExpression

A block formula (<tg-math-block>).

Fields

§expression: String

The expression in LaTeX format.

§

Anchor

An anchor (<a name="…">).

Fields

§name: String

The name of the anchor.

§

List

A list (<ul> / <ol>).

Fields

§items: Vec<InputRichBlockListItem>

Items of the list.

§

BlockQuotation

A block quotation (<blockquote>).

Fields

§blocks: Vec<InputRichBlock>

Content of the block.

§credit: Option<RichText>

Optional. Credit of the block.

§

ExpandableBlockQuotation

An expandable block quotation (<blockquote expandable>, Bot API 10.3).

Fields

§text: RichText

Content of the block.

§credit: Option<RichText>

Optional. Credit of the block.

§

PullQuotation

A quotation with centered text (<aside>).

Fields

§text: RichText

Text of the block.

§credit: Option<RichText>

Optional. Credit of the block.

§

Collage

A collage (<tg-collage>).

Fields

§blocks: Vec<InputRichBlock>

Elements of the collage.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Slideshow

A slideshow (<tg-slideshow>).

Fields

§blocks: Vec<InputRichBlock>

Elements of the slideshow.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Table

A table (<table>).

Fields

§cells: Vec<Vec<RichBlockTableCell>>

Cells of the table.

§is_bordered: Option<bool>

Optional. The table has borders.

§is_striped: Option<bool>

Optional. The table is striped.

§is_compact: Option<bool>

Optional. Cells have smaller indents (Bot API 10.3).

§caption: Option<RichText>

Optional. Caption of the table.

§

Details

An expandable details block (<details>).

Fields

§summary: RichText

Always shown summary of the block.

§blocks: Vec<InputRichBlock>

Content of the block.

§is_open: Option<bool>

Optional. The content is visible by default.

§

Map

A map (<tg-map>).

Fields

§location: Location

Location of the center of the map.

§zoom: Option<u8>

Optional. Zoom level; 0-24.

§width: Option<u32>

Optional. Width; 0-10000.

§height: Option<u32>

Optional. Height; 0-10000.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Buttons

A row of 1-8 buttons (<tg-button-row>, Bot API 10.3).

Fields

§buttons: Vec<RichMessageButton>

List of 1-8 buttons.

§align: Option<HorizontalAlign>

Optional. Horizontal alignment.

§

Animation

An animation (<video>).

Fields

§animation: InputMediaAnimation

The animation; caption is ignored.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Audio

A music file (<audio>).

Fields

§audio: InputMediaAudio

The audio; caption is ignored.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Document

A general file (<tg-document>, Bot API 10.3).

Fields

§document: InputMediaDocument

The document; caption is ignored.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Photo

A photo (<img>).

Fields

§photo: InputMediaPhoto

The photo; caption is ignored.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Video

A video (<video>).

Fields

§video: InputMediaVideo

The video; caption is ignored.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

VoiceNote

A voice note (<audio>).

Fields

§voice_note: InputMediaVoiceNote

The voice note; caption is ignored.

§caption: Option<RichBlockCaption>

Optional. Caption of the block.

§

Thinking

A “Thinking…” placeholder; only valid in sendRichMessageDraft.

Fields

§text: RichText

Text of the block.

Trait Implementations§

Source§

impl Clone for InputRichBlock

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for InputRichBlock

Source§

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

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

impl<'de> Deserialize<'de> for InputRichBlock

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 PartialEq for InputRichBlock

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for InputRichBlock

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
Source§

impl StructuralPartialEq for InputRichBlock

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.