Crate runtime
Available on crate feature
runtime only.Expand description
The compio runtime.
let ans = compio_runtime::Runtime::new().unwrap().block_on(async {
println!("Hello world!");
42
});
assert_eq!(ans, 42);Modules§
- event
event - Events utilities.
- future
future-combinator - Future combinators.
- time
time - Utilities for tracking time.
Structs§
- Attacher
- Attach a handle to the driver of current thread.
- Borrowed
Buffer - Buffer borrowed from buffer pool
- Buffer
Pool - Buffer pool
- OptWaker
- An optimized waker that avoids unnecessary wake-ups on the same thread.
- Runtime
- The async runtime of compio.
- Runtime
Builder - Builder for
Runtime. - Submit
- Return type for
Runtime::submit - Task
- A spawned task.
Functions§
- spawn
- Spawns a new asynchronous task, returning a
Taskfor it. - spawn_
blocking - Spawns a blocking task in a new thread, and wait for it.
- submit
- Submit an operation to the current runtime, and return a future for it.
- submit_
with_ extra Deprecated - Submit an operation to the current runtime, and return a future for it with flags.
Type Aliases§
- Join
Handle - Type alias for
Task<Result<T, Box<dyn Any + Send>>>, which resolves to anErrwhen the spawned future panicked.