pub fn block_on<
    Item: Send + 'static,
    Error: Send + 'static,
    F: Future<Item = Item, Error = Error> + Send + 'static,
  >(
    &self,
    future: F,
  ) -> Result<Item, Error> {
    // Make sure to copy our (thread-local) logging destination into the task.
    // When a daemon thread kicks off a future, it should log like a daemon thread (and similarly
    // for a user-facing thread).
    let logging_destination = logging::get_destination();
    self
      .runtime
      .get()
      .write()
      .block_on(futures::future::ok(()).and_then(move |()| {
        logging::set_destination(logging_destination);
        future
      }))
  }
///
/// Run a Future and return its resolved Result.
///
/// This should never be called from in a Future context, or any context where anyone may want to
/// spawn something on the runtime using Core::spawn.
///
Run a Future and return its resolved Result.
This should never be called from in a Future context, or any context where anyone may want to
spawn something on the runtime using Core::spawn.
Run a Future and return its resolved Result . This should never be called from in a Future context or any context where anyone may want to spawn something on the runtime using Core :: spawn .
pub fn block_on<
    Item: Send + 'static,
    Error: Send + 'static,
    F: Future<Item = Item, Error = Error> + Send + 'static,
  >(
    &self,
    future: F,
  ) -> Result<Item, Error> {
    // Make sure to copy our (thread-local) logging destination into the task.
    // When a daemon thread kicks off a future, it should log like a daemon thread (and similarly
    // for a user-facing thread).
    let logging_destination = logging::get_destination();
    self
      .runtime
      .get()
      .write()
      .block_on(futures::future::ok(()).and_then(move |()| {
        logging::set_destination(logging_destination);
        future
      }))
  }
pub fn block_on < Item : Send + ' static , Error : Send + ' static , F : Future < Item = Item , Error = Error > + Send + ' static , > ( & self , future : F , ) -> Result < Item , Error > { // Make sure to copy our (thread-local) logging destination into the task. // When a daemon thread kicks off a future, it should log like a daemon thread (and similarly // for a user-facing thread). let logging_destination = logging :: get_destination ( ) ; self . runtime . get ( ) . write ( ) . block_on ( futures :: future :: ok ( ( ) ) . and_then ( move | ( ) | { logging :: set_destination ( logging_destination ) ; future } ) ) }
Run a Future and return its resolved Result.
Run a Future and return its resolved Result .
&self
future
F
&self
future
F