Enum telebot::file::File [−][src]
pub enum File { Memory { name: String, source: Box<Read + Send>, }, Disk { path: PathBuf, }, Telegram(String), Url(String), }
A Telegram file which contains a readable source and a filename
Variants
Memory
Fields of Memory
name: String | |
source: Box<Read + Send> |
Disk
Fields of Disk
path: PathBuf |
Telegram(String)
Url(String)
Methods
impl File
[src]
impl File
Trait Implementations
impl<'a> TryFrom<&'a str> for File
[src]
impl<'a> TryFrom<&'a str> for File
Construct a Telegram file from a local path
type Error = Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(path: &'a str) -> Result<Self, Self::Error>
[src]
fn try_from(path: &'a str) -> Result<Self, Self::Error>
🔬 This is a nightly-only experimental API. (
try_from
)Performs the conversion.
impl<'a, S: Read + Send + 'static> TryFrom<(&'a str, S)> for File
[src]
impl<'a, S: Read + Send + 'static> TryFrom<(&'a str, S)> for File
Construct a Telegram file from an object which implements the Read trait
type Error = Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from((name, source): (&'a str, S)) -> Result<Self, Self::Error> where
S: Read + Send,
[src]
fn try_from((name, source): (&'a str, S)) -> Result<Self, Self::Error> where
S: Read + Send,
🔬 This is a nightly-only experimental API. (
try_from
)Performs the conversion.