Struct botapi::gen_types::AudioBuilder
source · pub struct AudioBuilder {
pub file_id: String,
pub file_unique_id: String,
pub duration: i64,
pub performer: Option<String>,
pub title: Option<String>,
pub file_name: Option<String>,
pub mime_type: Option<String>,
pub file_size: Option<i64>,
pub thumbnail: Option<BoxWrapper<Unbox<PhotoSize>>>,
}
Expand description
This object represents an audio file to be treated as music by the Telegram clients.
Fields§
§file_id: String
Identifier for this file, which can be used to download or reuse the file
file_unique_id: String
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
duration: i64
Duration of the audio in seconds as defined by sender
performer: Option<String>
Optional. Performer of the audio as defined by sender or by audio tags
title: Option<String>
Optional. Title of the audio as defined by sender or by audio tags
file_name: Option<String>
Optional. Original filename as defined by sender
mime_type: Option<String>
Optional. MIME type of the file as defined by sender
file_size: Option<i64>
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
thumbnail: Option<BoxWrapper<Unbox<PhotoSize>>>
Optional. Thumbnail of the album cover to which the music file belongs
Implementations§
source§impl AudioBuilder
impl AudioBuilder
pub fn new(file_id: String, file_unique_id: String, duration: i64) -> Self
sourcepub fn set_file_id(self, file_id: String) -> Self
pub fn set_file_id(self, file_id: String) -> Self
Identifier for this file, which can be used to download or reuse the file
sourcepub fn set_file_unique_id(self, file_unique_id: String) -> Self
pub fn set_file_unique_id(self, file_unique_id: String) -> Self
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
sourcepub fn set_duration(self, duration: i64) -> Self
pub fn set_duration(self, duration: i64) -> Self
Duration of the audio in seconds as defined by sender
sourcepub fn set_performer(self, performer: String) -> Self
pub fn set_performer(self, performer: String) -> Self
Optional. Performer of the audio as defined by sender or by audio tags
sourcepub fn set_title(self, title: String) -> Self
pub fn set_title(self, title: String) -> Self
Optional. Title of the audio as defined by sender or by audio tags
sourcepub fn set_file_name(self, file_name: String) -> Self
pub fn set_file_name(self, file_name: String) -> Self
Optional. Original filename as defined by sender
sourcepub fn set_mime_type(self, mime_type: String) -> Self
pub fn set_mime_type(self, mime_type: String) -> Self
Optional. MIME type of the file as defined by sender
sourcepub fn set_file_size(self, file_size: i64) -> Self
pub fn set_file_size(self, file_size: i64) -> Self
Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
sourcepub fn set_thumbnail(self, thumbnail: PhotoSize) -> Self
pub fn set_thumbnail(self, thumbnail: PhotoSize) -> Self
Optional. Thumbnail of the album cover to which the music file belongs
pub fn build(self) -> Audio
Trait Implementations§
source§impl Clone for AudioBuilder
impl Clone for AudioBuilder
source§fn clone(&self) -> AudioBuilder
fn clone(&self) -> AudioBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AudioBuilder
impl Debug for AudioBuilder
source§impl Default for AudioBuilder
impl Default for AudioBuilder
source§fn default() -> AudioBuilder
fn default() -> AudioBuilder
source§impl<'de> Deserialize<'de> for AudioBuilder
impl<'de> Deserialize<'de> for AudioBuilder
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Hash for AudioBuilder
impl Hash for AudioBuilder
source§impl Ord for AudioBuilder
impl Ord for AudioBuilder
source§fn cmp(&self, other: &AudioBuilder) -> Ordering
fn cmp(&self, other: &AudioBuilder) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for AudioBuilder
impl PartialEq for AudioBuilder
source§fn eq(&self, other: &AudioBuilder) -> bool
fn eq(&self, other: &AudioBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for AudioBuilder
impl PartialOrd for AudioBuilder
source§fn partial_cmp(&self, other: &AudioBuilder) -> Option<Ordering>
fn partial_cmp(&self, other: &AudioBuilder) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for AudioBuilder
impl Serialize for AudioBuilder
impl Eq for AudioBuilder
impl StructuralPartialEq for AudioBuilder
Auto Trait Implementations§
impl Freeze for AudioBuilder
impl RefUnwindSafe for AudioBuilder
impl Send for AudioBuilder
impl Sync for AudioBuilder
impl Unpin for AudioBuilder
impl UnwindSafe for AudioBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.