Struct tokio::runtime::current_thread::Builder [−][src]
pub struct Builder { /* fields omitted */ }Builds a Single-threaded 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
extern crate tokio; extern crate tokio_timer; use tokio::runtime::current_thread::Builder; use tokio_timer::clock::Clock; // build Runtime let runtime = Builder::new() .clock(Clock::new()) .build(); // ... call runtime.run(...)
Methods
impl Builder[src]
impl Builderpub fn new() -> Builder[src]
pub fn new() -> BuilderReturns a new runtime builder initialized with default configuration values.
Configuration methods can be chained on the return value.
ⓘImportant traits for &'a mut Rpub fn clock(&mut self, clock: Clock) -> &mut Self[src]
ⓘImportant traits for &'a mut R
pub fn clock(&mut self, clock: Clock) -> &mut SelfSet the Clock instance that will be used by the runtime.
pub fn build(&mut self) -> Result<Runtime>[src]
pub fn build(&mut self) -> Result<Runtime>Create the configured Runtime.