Crate stakker_async_await

Crate stakker_async_await 

Source
Expand description

Stakker interface to Rust async/await

Stakker has two primitives for asynchronous callbacks, i.e. for passing data from one point to another:

  • stakker::Ret accepts a single value to pass to an end-point, and is consumed when used to guarantee that it is not used again

  • stakker::Fwd accepts an endless stream of values to pass to an end-point, and can be cloned

An end-point would typically be a method on an actor, and the value would be passed in a call to that method. However other types of end-point are possible.

The Rust standard library Future is like a Ret in reverse. A Ret sends the response to an end-point, but a Future is held by the end-point to receive the response.

Structs§

ActorFail
Error representing failure of an actor

Functions§

current_task
Get a reference to the current task
future_pull
Create a pull-style RetFuture pipe, that drops the task on failure
future_pull_result
Create a pull-style RetFuture pipe, that passes through failure
fwd_to_stream
Create a FwdStream pipe which drops the task on failure
fwd_to_stream_result
Create a FwdStream pipe which passes through failure
ret_to_future
Create a push-style RetFuture pipe, that drops the task on failure
ret_to_future_result
Create a push-style RetFuture pipe, that passes through failure
spawn_future
Spawn a Future and pass the final result to the given Ret
spawn_future_with_waker
Spawn a Future and pass the final result to the given Ret, with Waker support
spawn_stream
Spawn a Stream, forwarding values to a Fwd
spawn_stream_with_waker
Spawn a Stream, forwarding values to a Fwd, with Waker support.