Crate microasync_rt

Source

Modules§

io
MicroAsync-Util provides some AsyncIO for Files, TCP, and UDP. These are provided by the ReadAsync and WriteAsync traits.

Macros§

join
join_boxed

Structs§

DeferredFuture
A future that runs a function in a new thread without blocking.
JoinedFuture
A future cosisting of multiple other futures. Ready once all of the inner futures are ready.
OwnedRuntime
Owned wrapper for anything that implements InternalRuntime, used to add a Runtime impl.
QueuedRuntime
A very small async runtime, with support for adding more tasks as it runs. This uses a VecDeque internally.
RuntimeWrapper
Wrapper for anything that implements InternalRuntime, used to add a Runtime impl.
SpawnedFuture
Future equivalent of a join handle
Stop
A never-completing future, used in stopping the runtime. Returns stable equivalent of !
Timer
YieldFuture
A future which returns Pending once, and returns Ready the next time it is polled. Used to interrupt a running task to make space for others to run.

Enums§

Never
Stable wrapper of ! type for the Stop struct.

Traits§

InternalRuntime
Trait to be implemented by async runtimes
Runtime
Auto-trait with the methods that will actually be called by the users of the runtime.
StartableRuntime
Trait to construct a runtime

Functions§

clear_current_runtime
This clears the currently running runtime. MUST ONLY BE CALLED BY A RUNTIME WHEN IT WILL (temporarily of permanently) STOP EXECUTING FUTURES. MUST FOLLOW A set_current_runtime CALL. IF THE RUNTIME STARTS TO BE USED AGAIN, set_current_runtime MUST BE CALLED AGAIN.
defer
Defers execution of a blocking function to another thread returning a DeferredFuture, which does nothing until it is awaited.
get_current_runtime
This gets the currently running runtime. PANICS IF IT IS CALLED FROM OUTSIDE THE RUNTIME.
join
Joins multiple futures into one, which will be ready once all of the inner ones are. This is effectively a small one-time-use runtime without the ability to add any tasks.
prep
set_current_runtime
This sets the currently running runtime. MUST ONLY BE CALLED BY A RUNTIME WHEN IT IS ABOUT TO START EXECUTING, AND MUST BE CLEARED AFTERWARDS.
wait
wait_ms
yield_now
Interrupts the current task and yields for the ohers. This uses a YieldFuture

Type Aliases§

BoxFuture