[−][src]Struct tokio::runtime::current_thread::Builder
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]
pub fn new() -> Builder
[src]
Returns a new 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]
Set the Clock
instance that will be used by the runtime.
pub fn build(&mut self) -> Result<Runtime>
[src]
Create the configured Runtime
.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,