Skip to main content

InputRichBlock

Enum InputRichBlock 

Source
pub enum InputRichBlock {
Show 21 variants Paragraph(InputRichBlockParagraph), SectionHeading(InputRichBlockSectionHeading), Preformatted(InputRichBlockPreformatted), Footer(InputRichBlockFooter), Divider(InputRichBlockDivider), MathematicalExpression(InputRichBlockMathematicalExpression), Anchor(InputRichBlockAnchor), List(InputRichBlockList), BlockQuotation(InputRichBlockBlockQuotation), PullQuotation(InputRichBlockPullQuotation), Collage(InputRichBlockCollage), Slideshow(InputRichBlockSlideshow), Table(InputRichBlockTable), Details(InputRichBlockDetails), Map(InputRichBlockMap), Animation(InputRichBlockAnimation), Audio(InputRichBlockAudio), Photo(InputRichBlockPhoto), Video(InputRichBlockVideo), VoiceNote(InputRichBlockVoiceNote), Thinking(InputRichBlockThinking),
}
Expand description

A block in a rich formatted message to be sent.

This is the input-side counterpart to RichBlock — used to build InputRichMessage::blocks rather than to read a received RichMessage.

Variants§

§

Paragraph(InputRichBlockParagraph)

A text paragraph, corresponding to the HTML tag <p>.

§

SectionHeading(InputRichBlockSectionHeading)

A section heading, corresponding to the HTML tags <h1><h6>.

§

Preformatted(InputRichBlockPreformatted)

A preformatted text block, corresponding to the nested HTML tags <pre> and <code>.

§

Footer(InputRichBlockFooter)

A footer, corresponding to the HTML tag <footer>.

§

Divider(InputRichBlockDivider)

A divider, corresponding to the HTML tag <hr/>.

§

MathematicalExpression(InputRichBlockMathematicalExpression)

A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag <tg-math-block>.

§

Anchor(InputRichBlockAnchor)

A block with an anchor, corresponding to the HTML tag <a> with the attribute name.

§

List(InputRichBlockList)

A list of blocks, corresponding to the HTML tag <ul> or <ol> with nested <li> tags.

§

BlockQuotation(InputRichBlockBlockQuotation)

A block quotation, corresponding to the HTML tag <blockquote>.

§

PullQuotation(InputRichBlockPullQuotation)

A quotation with centered text, loosely corresponding to the HTML tag <aside>.

§

Collage(InputRichBlockCollage)

A collage, corresponding to the custom HTML tag <tg-collage>.

§

Slideshow(InputRichBlockSlideshow)

A slideshow, corresponding to the custom HTML tag <tg-slideshow>.

§

Table(InputRichBlockTable)

A table, corresponding to the HTML tag <table>.

§

Details(InputRichBlockDetails)

An expandable block for details disclosure, corresponding to the HTML tag <details>.

§

Map(InputRichBlockMap)

A block with a map, corresponding to the custom HTML tag <tg-map>.

§

Animation(InputRichBlockAnimation)

A block with an animation, corresponding to the HTML tag <video>.

§

Audio(InputRichBlockAudio)

A block with a music file, corresponding to the HTML tag <audio>.

§

Photo(InputRichBlockPhoto)

A block with a photo, corresponding to the HTML tag <img>.

§

Video(InputRichBlockVideo)

A block with a video, corresponding to the HTML tag <video>.

§

VoiceNote(InputRichBlockVoiceNote)

A block with a voice note, corresponding to the HTML tag <audio>.

§

Thinking(InputRichBlockThinking)

A Thinking… placeholder, corresponding to the custom HTML tag <tg-thinking>.

May be used only in sendRichMessageDraft calls — it cannot be received in messages. See https://t.me/addemoji/AIActions for recommended custom emoji.

Trait Implementations§

Source§

impl Clone for InputRichBlock

Source§

fn clone(&self) -> InputRichBlock

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

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 = 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.