Skip to main content

Module util

Module util 

Source
Expand description

A collection of utilities to deal with IO, futures and runtimes

Structs§

DummyIO
A dummy struct implementing Async IO traits
DummyStream
A dummy struct implementing Stream
IOHandle
A synchronous IO handle
Join
Future returned by join.
ReadHalf
The read half produced by split.
RuntimeParts
A RuntimeKit composed of independent Executor and Reactor instances.
SocketAddrs
Wrapper to impl AsyncToSocketAddrs from an IntoIterator<Item = SocketAddr>
SocketAddrsFromIpAddrs
Iterator for SocketAddr computed from IpAddr + port
SocketAddrsResolver
Wrapper to perform blocking name resolution on top of an async runtime
Task
A wrapper around implementation-specific tasks that implement the TaskImpl trait
TryJoin
Future returned by try_join.
WriteHalf
The write half produced by split.

Traits§

TaskImpl
A common interface to wait for a Task completion, let it run in the background or cancel it.

Functions§

block_on_tokio
Block on the given future in a tokio context, creating a new one if required
inside_tokio
Check whether we’re in a tokio context or not
join
Drive two futures concurrently, returning both outputs once both complete.
simple_block_on
Simple naive block_on implementation for noop runtime
split
Split a bidirectional stream into independently-owned read and write halves.
try_join
Drive two fallible futures concurrently, short-circuiting on the first error.