pub async fn send_timeout<Req: Request>(
        &self,
        request: Req,
        duration: Duration,
    ) -> Result<<Req::Response as ResponseType>::Type, Error> {
        tokio::time::timeout(duration, self.send(request)).await?
    }
/// Send a request to the Telegram server and wait for a response, timing out after `duration`.
/// Future will resolve to `None` if timeout fired.
///
/// # Examples
///
/// ```rust
/// # extern crate futures;
/// # extern crate telegram_bot_fork;
/// # extern crate tokio;
/// # use futures::Future;
/// # use telegram_bot_fork::{DefaultApi, GetMe, Error};
/// #
/// # #[tokio::main]
/// # pub async fn main() -> Result<(), Error> {
/// # let telegram_token = "token";
/// # let api = DefaultApi::new_default(telegram_token.to_string()).unwrap();
/// # if false {
/// use std::time::Duration;
///
/// let resp = api.send_timeout(GetMe, Duration::from_secs(5)).await?;
/// # }
/// Ok(())
/// # }
/// ```
Send a request to the Telegram server and wait for a response, timing out after `duration`.
Future will resolve to `None` if timeout fired.
Send a request to the Telegram server and wait for a response timing out after ` duration ` . Future will resolve to ` None ` if timeout fired .
pub async fn send_timeout<Req: Request>(
        &self,
        request: Req,
        duration: Duration,
    ) -> Result<<Req::Response as ResponseType>::Type, Error> {
        tokio::time::timeout(duration, self.send(request)).await?
    }
pub async fn send_timeout < Req : Request > ( & self , request : Req , duration : Duration , ) -> Result < < Req :: Response as ResponseType > :: Type , Error > { tokio :: time :: timeout ( duration , self . send ( request ) ) . await ? }
Send a request to the Telegram server and wait for a response, timing out after `duration`.
Send a request to the Telegram server and wait for a response timing out after ` duration ` .
&self
request
Req
duration
Duration
&self
request
Req
duration
Duration
examples
None
extern crate futures;
None
extern crate telegram_bot_fork;
None
extern crate tokio;
None
use futures::future;
None
use telegram_bot_fork::{defaultapi, getme, error};
None
#[tokio::main]
None
pub async fn main() -> result<(), error> {
None
let telegram_token = "token";
None
let api = defaultapi::new_default(telegram_token.to_string()).unwrap();
None
if false {
use std::time::Duration.

let resp = api.send_timeout(GetMe, Duration::from_secs(5)).await?.
use std :: time :: Duration . let resp = api . send_timeout ( GetMe Duration :: from_secs ( 5 )) . await? .
}
None
}
None