pub struct Document {
pub raw: Document,
}Expand description
Ergonomic wrapper over a Telegram document (file, video, audio, …).
Fields§
§raw: DocumentImplementations§
Source§impl Document
impl Document
pub fn from_raw(raw: Document) -> Self
Sourcepub fn from_media(media: &MessageMedia) -> Option<Self>
pub fn from_media(media: &MessageMedia) -> Option<Self>
Try to extract from a MessageMedia variant.
pub fn id(&self) -> i64
pub fn access_hash(&self) -> i64
pub fn date(&self) -> i32
pub fn mime_type(&self) -> &str
pub fn size(&self) -> i64
Sourcepub fn is_animated(&self) -> bool
pub fn is_animated(&self) -> bool
true if the document has animated sticker attributes.
Trait Implementations§
Source§impl Downloadable for Document
impl Downloadable for Document
Source§fn to_input_location(&self) -> Option<InputFileLocation>
fn to_input_location(&self) -> Option<InputFileLocation>
Return the
InputFileLocation needed for upload.getFile.Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more