Skip to main content

Headerline

Trait Headerline 

Source
pub trait Headerline:
    Send
    + Sync
    + 'static {
    // Required methods
    fn version(&self) -> u64;
    fn render(&self) -> Option<HeaderlineRow>;
}
Expand description

Anything that can supply a sticky headerline row.

The cells worker calls version() on every tick. When the version has advanced, it calls render() to rebuild the displayed row. render() returns None to hide the row entirely (e.g. while idle).

Required Methods§

Source

fn version(&self) -> u64

Monotonic counter. Bump whenever the row content changes. The worker skips render() when the version is unchanged since the last call.

Source

fn render(&self) -> Option<HeaderlineRow>

Build the current row. Return None to hide the header entirely. Must not block — cache results; background tasks push updates via the owning handle.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S: Send + Sync + 'static> Headerline for SimpleHeaderline<S>