Skip to main content

InputMediaVideo

Struct InputMediaVideo 

Source
pub struct InputMediaVideo {
Show 14 fields pub tg_type: String, pub media: Option<InputFile>, pub thumbnail: Option<String>, pub cover: Option<String>, pub start_timestamp: Option<i64>, pub caption: Option<String>, pub parse_mode: Option<String>, pub caption_entities: Option<Vec<MessageEntity>>, pub show_caption_above_media: Option<bool>, pub width: Option<i64>, pub height: Option<i64>, pub duration: Option<i64>, pub supports_streaming: Option<bool>, pub has_spoiler: Option<bool>,
}
Expand description

Represents a video to be sent.

Fields§

§tg_type: String

Type of the result, must be video

§media: Option<InputFile>

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

§thumbnail: Option<String>

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

§cover: Option<String>

Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

§start_timestamp: Option<i64>

Optional. Start timestamp for the video in the message

§caption: Option<String>

Optional. Caption of the video to be sent, 0-1024 characters after entities parsing

§parse_mode: Option<String>

Optional. Mode for parsing entities in the video caption. See formatting options for more details.

§caption_entities: Option<Vec<MessageEntity>>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

§show_caption_above_media: Option<bool>

Optional. Pass True, if the caption must be shown above the message media

§width: Option<i64>

Optional. Video width

§height: Option<i64>

Optional. Video height

§duration: Option<i64>

Optional. Video duration in seconds

§supports_streaming: Option<bool>

Optional. Pass True if the uploaded video is suitable for streaming

§has_spoiler: Option<bool>

Optional. Pass True if the video needs to be covered with a spoiler animation

Implementations§

Source§

impl InputMediaVideo

Source§

impl InputMediaVideo

Source

pub fn new(media: Option<InputFile>) -> Self

Source

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

Type of the result, must be video

Source

pub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self

Type of the result, must be video

Source

pub fn get_media<'a>(&'a self) -> &'a Option<InputFile>

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

Source

pub fn set_media<'a>(&'a mut self, media: Option<InputFile>) -> &'a mut Self

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

Source

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

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

Source

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

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

Source

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

Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

Source

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

Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files

Source

pub fn get_start_timestamp<'a>(&'a self) -> Option<i64>

Optional. Start timestamp for the video in the message

Source

pub fn set_start_timestamp<'a>( &'a mut self, start_timestamp: Option<i64>, ) -> &'a mut Self

Optional. Start timestamp for the video in the message

Source

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

Optional. Caption of the video to be sent, 0-1024 characters after entities parsing

Source

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

Optional. Caption of the video to be sent, 0-1024 characters after entities parsing

Source

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

Optional. Mode for parsing entities in the video caption. See formatting options for more details.

Source

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

Optional. Mode for parsing entities in the video caption. See formatting options for more details.

Source

pub fn get_caption_entities<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

Source

pub fn set_caption_entities<'a>( &'a mut self, caption_entities: Option<Vec<MessageEntity>>, ) -> &'a mut Self

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

Source

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

Optional. Pass True, if the caption must be shown above the message media

Source

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

Optional. Pass True, if the caption must be shown above the message media

Source

pub fn get_width<'a>(&'a self) -> Option<i64>

Optional. Video width

Source

pub fn set_width<'a>(&'a mut self, width: Option<i64>) -> &'a mut Self

Optional. Video width

Source

pub fn get_height<'a>(&'a self) -> Option<i64>

Optional. Video height

Source

pub fn set_height<'a>(&'a mut self, height: Option<i64>) -> &'a mut Self

Optional. Video height

Source

pub fn get_duration<'a>(&'a self) -> Option<i64>

Optional. Video duration in seconds

Source

pub fn set_duration<'a>(&'a mut self, duration: Option<i64>) -> &'a mut Self

Optional. Video duration in seconds

Source

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

Optional. Pass True if the uploaded video is suitable for streaming

Source

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

Optional. Pass True if the uploaded video is suitable for streaming

Source

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

Optional. Pass True if the video needs to be covered with a spoiler animation

Source

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

Optional. Pass True if the video needs to be covered with a spoiler animation

Trait Implementations§

Source§

impl Clone for InputMediaVideo

Source§

fn clone(&self) -> InputMediaVideo

Returns a duplicate 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 InputMediaVideo

Source§

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

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

impl Default for InputMediaVideo

Source§

fn default() -> InputMediaVideo

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

impl<'de> Deserialize<'de> for InputMediaVideo

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<BoxWrapper<Box<InputMediaVideo>>> for InputMediaVideo

Source§

fn from(t: BoxWrapper<Box<InputMediaVideo>>) -> Self

Converts to this type from the input type.
Source§

impl From<BoxWrapper<Unbox<InputMediaVideo>>> for InputMediaVideo

Source§

fn from(t: BoxWrapper<Unbox<InputMediaVideo>>) -> Self

Converts to this type from the input type.
Source§

impl From<NoSkipInputMediaVideo> for InputMediaVideo

Source§

fn from(t: NoSkipInputMediaVideo) -> Self

Converts to this type from the input type.
Source§

impl Hash for InputMediaVideo

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Into<NoSkipInputMediaVideo> for InputMediaVideo

Source§

fn into(self) -> NoSkipInputMediaVideo

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

impl Ord for InputMediaVideo

Source§

fn cmp(&self, other: &InputMediaVideo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for InputMediaVideo

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for InputMediaVideo

Source§

fn partial_cmp(&self, other: &InputMediaVideo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for InputMediaVideo

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 Eq for InputMediaVideo

Source§

impl StructuralPartialEq for InputMediaVideo

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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.
Source§

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

Source§

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 T
where T: for<'de> Deserialize<'de>,