Crate lazy_async_promise
source ·Expand description
Primitives for combining tokio and immediate mode guis
Currently, only three primitives are implemented:
LazyVecPromise: A lazily evaluated, partially readable and async-enabled vector-backed promiseLazyValuePromise: A lazily evaluated and async-enabled single value promiseImmediateValuePromise: An immediately updating async-enabled single value promise See these items for their respective documentation. A general usage guide would be:- You want several items of the same kind displayed / streamed? Use:
LazyVecPromise - You want one item displayed when ready and need lazy evaluation or have intermediate results? Use:
LazyVecPromise - You just want one item displayed when ready? Use:
ImmediateValuePromise(for laziness wrap inOption)
Modules
Use this to get all macros
Macros
Send new data via the sender
Setting the given progress using a given sender.
Set state to
DataState::UpToDateSetting the given progress using a given sender.
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
A promise which can be easily created and stored.
A single lazy-async updated value
A lazy, async and partially readable vector promise
a f64 type which is constrained to the range of 0.0 and 1.0
Enums
Represents a processing state.
The return state of a
ImmediateValuePromise, contains the error, the value or that it is still updatingThe 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
Trait for directly accessing the cache underneath any promise
Maybe this should rather be called “LazyUpdating”?
Implementors can react to polling by queueing an update if needed.
Update should force an update.