[][src]Enum telebot::file::File

pub enum File {
    Memory {
        name: String,
        source: Box<dyn 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: Stringsource: Box<dyn Read + Send>
Disk

Fields of Disk

path: PathBuf
Telegram(String)
Url(String)

Methods

impl File[src]

pub fn name(&self) -> String[src]

pub fn try_from<T: TryIntoFile>(value: T) -> Result<Self, T::Error>[src]

Trait Implementations

impl TryIntoFile for File[src]

type Error = ()

Auto Trait Implementations

impl Send for File

impl !Sync for File

impl Unpin for File

impl !UnwindSafe for File

impl !RefUnwindSafe for File

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T