Enum teloxide_core::errors::DownloadError
source · pub enum DownloadError {
Network(Error),
Io(Error),
}
Expand description
An error caused by downloading a file.
Variants§
Network(Error)
A network error while downloading a file from Telegram.
Io(Error)
An I/O error while writing a file to destination.
Trait Implementations§
source§impl Debug for DownloadError
impl Debug for DownloadError
source§impl Display for DownloadError
impl Display for DownloadError
source§impl Error for DownloadError
impl Error for DownloadError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<DownloadError> for RequestError
impl From<DownloadError> for RequestError
This impl allows to use ?
to propagate DownloadError
s in function
returning RequestError
s. For example:
async fn handler() -> Result<(), RequestError> {
download_file().await?; // `?` just works
Ok(())
}
async fn download_file() -> Result<(), DownloadError> {
/* download file here */
Ok(())
}
source§fn from(download_err: DownloadError) -> Self
fn from(download_err: DownloadError) -> Self
Converts to this type from the input type.