[][src]Struct tokio_compat::runtime::current_thread::Builder

pub struct Builder { /* fields omitted */ }
This is supported on (feature="rt-current-thread" or feature="rt-full") and feature="rt-current-thread" only.

Builds a single-threaded compatibility runtime with custom configuration values.

Methods can be chained in order to set the configuration values. The Runtime is constructed by calling build.

New instances of Builder are obtained via Builder::new.

See function level documentation for details on the various configuration settings.

Examples

use tokio_compat::runtime::current_thread::Builder;
use tokio_timer_02::clock::Clock;

// build Runtime
let runtime = Builder::new()
    .clock(Clock::new())
    .build();
// ... call runtime.run(...)

Methods

impl Builder[src]

pub fn new() -> Builder[src]

This is supported on feature="rt-current-thread" or feature="rt-full" only.

Returns a new compatibility runtime builder initialized with default configuration values.

Configuration methods can be chained on the return value.

pub fn clock(&mut self, clock: Clock) -> &mut Self[src]

This is supported on feature="rt-current-thread" or feature="rt-full" only.

Set the Clock instance that will be used by the runtime.

pub fn build(&mut self) -> Result<Runtime>[src]

This is supported on feature="rt-current-thread" or feature="rt-full" only.

Create the configured Runtime.

Trait Implementations

impl Debug for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

impl !RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl !UnwindSafe for Builder

Blanket Implementations

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

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

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

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 = Infallible

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.