Skip to main content

Module late

Module late 

Source
Expand description

Late values: a cell for a value that arrives after asynchronous work (a volume’s free space, a folder’s size, a count from a database), in four states (Late):

Experimental: may change in any release (docs/stability.md).

The cell keeps the spinner’s room in every state, so its size is the same pending, fresh and refreshing. Its accessible node (a status) keeps the value’s name; its value says the state (the value, “Loading”, the error) and it is busy while the work runs.

use egui_pop_core::late::{Late, LateValue};

fn ui(ui: &mut egui::Ui, free: &Late<String>) {
    let cell = LateValue::new("Free space", free.clone())
        .sample("000.0 GB")
        .show(ui);
    if cell.retry {
        // Run the work again.
    }
}

Structs§

LateResponse
What LateValue::show returns.
LateValue
A cell showing a value that arrives late, in its four states.

Enums§

Late
Where a late value stands.
Waiting
What stands in for a pending value.