Crate lazy_async_promise

Source
Expand description

§Primitives for combining tokio and immediate mode guis

§List of primitives

The following primitives are implemented:

See these items for their respective documentation.

§What to use

A general usage guide would be:

Modules§

api_macros
Use this to get all macros

Macros§

send_data
Send new data via the sender
set_error
Setting the given progress using a given sender.
set_finished
Set state to DataState::UpToDate
set_progress
Setting the given progress using a given sender.
unpack_result
Error checking in async updater functions is tedious - this helps out by resolving results and sending errors on error. Result will be unwrapped if no error occurs.

Structs§

BoxedSendError
Strong type to keep the boxed error. You can just deref it to get the inside box.
ImmediateValuePromise
A promise which can be easily created and stored.
LazyValuePromise
A single lazy-async updated value
LazyVecPromise
A lazy, async and partially readable vector promise
Progress
a f64 type which is constrained to the range of 0.0 and 1.0
ProgressTrackedImValProm
A progress and status enabling wrapper for ImmediateValuePromise
Status
A status update struct containing the issue-date, progress and a message You can use any struct that can be transferred via tokio mpsc channels.

Enums§

DataState
Represents a processing state.
ImmediateValueState
The return state of a ImmediateValuePromise, contains the error, the value or that it is still updating
Message
The message-type to send from the updater to the main thread. There’s only two variants, NewData which allows to send new data or StateChange which allows to signal readiness or error.

Traits§

DirectCacheAccess
Trait for directly accessing the cache underneath any promise
Promise
Maybe this should rather be called “LazyUpdating”? Implementors can react to polling by queueing an update if needed. Update should force an update.

Type Aliases§

FutureResult
Type alias for futures with BoxedSendError
StringStatus
This Status typedef allows to use both: &'static str and String in a message