Expand description
§Primitives for combining tokio and immediate mode guis
§List of primitives
The following primitives are implemented:
ImmediateValuePromise
: An immediately updating async-enabled single value promiseProgressTrackedImValProm
: A progress/status emitting enhanced wrapper forImmediateValuePromise
LazyVecPromise
: A lazily evaluated, partially readable and async-enabled vector-backed promiseLazyValuePromise
: A lazily evaluated and async-enabled single value promise
See these items for their respective documentation.
§What to use
A general usage guide would be:
- You just want one value when ready? Use:
ImmediateValuePromise
(for laziness wrap inOption
) - If you need status update support for that, use
ProgressTrackedImValProm
- You want several items of the same kind / streamed? Use:
LazyVecPromise
- You want one item when ready and need lazy evaluation or have intermediate results? Use:
LazyValuePromise
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§
- Boxed
Send Error - Strong type to keep the boxed error. You can just deref it to get the inside box.
- Immediate
Value Promise - A promise which can be easily created and stored.
- Lazy
Value Promise - A single lazy-async updated value
- Lazy
VecPromise - A lazy, async and partially readable vector promise
- Progress
- a f64 type which is constrained to the range of 0.0 and 1.0
- Progress
Tracked ImVal Prom - 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§
- Data
State - Represents a processing state.
- Immediate
Value State - 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 orStateChange
which allows to signal readiness or error.
Traits§
- Direct
Cache Access - 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§
- Future
Result - Type alias for futures with BoxedSendError
- String
Status - This
Status
typedef allows to use both:&'static str
andString
in a message