pub struct Audio {
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 Audio
impl Audio
pub fn new(file_id: String, file_unique_id: String, duration: i64) -> Self
sourcepub fn get_file_id<'a>(&'a self) -> &'a str
pub fn get_file_id<'a>(&'a self) -> &'a str
Identifier for this file, which can be used to download or reuse the file
sourcepub fn set_file_id<'a>(&'a mut self, file_id: String) -> &'a mut Self
pub fn set_file_id<'a>(&'a mut self, file_id: String) -> &'a mut Self
Identifier for this file, which can be used to download or reuse the file
sourcepub fn get_file_unique_id<'a>(&'a self) -> &'a str
pub fn get_file_unique_id<'a>(&'a self) -> &'a str
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_file_unique_id<'a>(
&'a mut self,
file_unique_id: String,
) -> &'a mut Self
pub fn set_file_unique_id<'a>( &'a mut self, file_unique_id: String, ) -> &'a mut 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 get_duration<'a>(&'a self) -> i64
pub fn get_duration<'a>(&'a self) -> i64
Duration of the audio in seconds as defined by sender
sourcepub fn set_duration<'a>(&'a mut self, duration: i64) -> &'a mut Self
pub fn set_duration<'a>(&'a mut self, duration: i64) -> &'a mut Self
Duration of the audio in seconds as defined by sender
sourcepub fn get_performer<'a>(&'a self) -> Option<&'a str>
pub fn get_performer<'a>(&'a self) -> Option<&'a str>
Optional. Performer of the audio as defined by sender or by audio tags
sourcepub fn set_performer<'a>(
&'a mut self,
performer: Option<String>,
) -> &'a mut Self
pub fn set_performer<'a>( &'a mut self, performer: Option<String>, ) -> &'a mut Self
Optional. Performer of the audio as defined by sender or by audio tags
sourcepub fn get_title<'a>(&'a self) -> Option<&'a str>
pub fn get_title<'a>(&'a self) -> Option<&'a str>
Optional. Title of the audio as defined by sender or by audio tags
sourcepub fn set_title<'a>(&'a mut self, title: Option<String>) -> &'a mut Self
pub fn set_title<'a>(&'a mut self, title: Option<String>) -> &'a mut Self
Optional. Title of the audio as defined by sender or by audio tags
sourcepub fn get_file_name<'a>(&'a self) -> Option<&'a str>
pub fn get_file_name<'a>(&'a self) -> Option<&'a str>
Optional. Original filename as defined by sender
sourcepub fn set_file_name<'a>(
&'a mut self,
file_name: Option<String>,
) -> &'a mut Self
pub fn set_file_name<'a>( &'a mut self, file_name: Option<String>, ) -> &'a mut Self
Optional. Original filename as defined by sender
sourcepub fn get_mime_type<'a>(&'a self) -> Option<&'a str>
pub fn get_mime_type<'a>(&'a self) -> Option<&'a str>
Optional. MIME type of the file as defined by sender
sourcepub fn set_mime_type<'a>(
&'a mut self,
mime_type: Option<String>,
) -> &'a mut Self
pub fn set_mime_type<'a>( &'a mut self, mime_type: Option<String>, ) -> &'a mut Self
Optional. MIME type of the file as defined by sender
sourcepub fn get_file_size<'a>(&'a self) -> Option<i64>
pub fn get_file_size<'a>(&'a self) -> 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.
sourcepub fn set_file_size<'a>(&'a mut self, file_size: Option<i64>) -> &'a mut Self
pub fn set_file_size<'a>(&'a mut self, file_size: Option<i64>) -> &'a mut 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 get_thumbnail<'a>(&'a self) -> Option<&'a PhotoSize>
pub fn get_thumbnail<'a>(&'a self) -> Option<&'a PhotoSize>
Optional. Thumbnail of the album cover to which the music file belongs
sourcepub fn set_thumbnail<'a>(
&'a mut self,
thumbnail: Option<PhotoSize>,
) -> &'a mut Self
pub fn set_thumbnail<'a>( &'a mut self, thumbnail: Option<PhotoSize>, ) -> &'a mut Self
Optional. Thumbnail of the album cover to which the music file belongs
Trait Implementations§
source§impl<'de> Deserialize<'de> for Audio
impl<'de> Deserialize<'de> for Audio
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 From<NoSkipAudio> for Audio
impl From<NoSkipAudio> for Audio
source§fn from(t: NoSkipAudio) -> Self
fn from(t: NoSkipAudio) -> Self
source§impl Into<NoSkipAudio> for Audio
impl Into<NoSkipAudio> for Audio
source§fn into(self) -> NoSkipAudio
fn into(self) -> NoSkipAudio
source§impl Ord for Audio
impl Ord for Audio
source§impl PartialEq for Audio
impl PartialEq for Audio
source§impl PartialOrd for Audio
impl PartialOrd for Audio
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 moreimpl Eq for Audio
impl StructuralPartialEq for Audio
Auto Trait Implementations§
impl Freeze for Audio
impl RefUnwindSafe for Audio
impl Send for Audio
impl Sync for Audio
impl Unpin for Audio
impl UnwindSafe for Audio
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.