pub enum InputFile {
FileId(String),
Url(String),
Bytes {
filename: String,
data: Vec<u8>,
},
Path(PathBuf),
}Expand description
Represents a file to be uploaded to the Telegram API.
FileId— reference an already-uploaded file by itsfile_id.Url— let Telegram fetch the file from a URL directly.Bytes— upload raw bytes with an explicit filename.Path— upload a file from the local filesystem.
Variants§
FileId(String)
An already-uploaded Telegram file referenced by its file identifier.
Url(String)
A URL that Telegram will fetch on the sender’s behalf.
Bytes
Raw bytes to upload, with an explicit filename used for MIME-type inference.
Fields
Path(PathBuf)
A path on the local filesystem to be read and uploaded.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for InputFile
impl<'de> Deserialize<'de> for InputFile
Source§fn deserialize<D>(d: D) -> Result<InputFile, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<InputFile, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for InputFile
impl Serialize for InputFile
Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for InputFile
Auto Trait Implementations§
impl Freeze for InputFile
impl RefUnwindSafe for InputFile
impl Send for InputFile
impl Sync for InputFile
impl Unpin for InputFile
impl UnsafeUnpin for InputFile
impl UnwindSafe for InputFile
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