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§
- fd
- Utilities for working with file descriptors.
- 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
- Cancel
Token - A token that can be used to cancel multiple operations at once.
- 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
- Returned
FutureforRuntime::submit. - Submit
Multi - Returned [
Stream] forRuntime::submit_multi. - Task
- A spawned task.
Functions§
- register_
files - Register file descriptors for fixed-file operations with the current runtime’s io_uring instance.
- 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_
multi - Submit a multishot operation to the current runtime, and return a stream for it.
- unregister_
files - Unregister previously registered file descriptors from the current runtime’s io_uring instance.
Type Aliases§
- Join
Handle - Type alias for
Task<Result<T, Box<dyn Any + Send>>>, which resolves to anErrwhen the spawned future panicked.