pub struct SimpleHeaderlineHandle<S: Send + Sync + 'static>(/* private fields */);Expand description
Cheap-clone handle to a SimpleHeaderline<S>.
The mode holds the handle; the paired HeaderlineProvider holds a type-
erased Arc<dyn Headerline> pointing to the same allocation. Updates via
update are immediately visible to the next render() call.
Implementations§
Source§impl<S: Send + Sync + 'static> SimpleHeaderlineHandle<S>
impl<S: Send + Sync + 'static> SimpleHeaderlineHandle<S>
Sourcepub fn new(
initial: S,
renderer: impl Fn(&S) -> Option<HeaderlineRow> + Send + Sync + 'static,
) -> Self
pub fn new( initial: S, renderer: impl Fn(&S) -> Option<HeaderlineRow> + Send + Sync + 'static, ) -> Self
Create a new handle with initial state and a renderer closure.
The closure receives a shared reference to the state and returns the
row to display, or None to hide the header.
Sourcepub fn update(&self, f: impl FnOnce(&mut S))
pub fn update(&self, f: impl FnOnce(&mut S))
Mutate the state and bump the version so the cells worker rebuilds the row on the next tick.
Sourcepub fn provider(&self, provider_id: ProviderId) -> HeaderlineProvider
pub fn provider(&self, provider_id: ProviderId) -> HeaderlineProvider
Construct a HeaderlineProvider backed by this handle. Register the
result with register_virtual_row_provider; keep the handle for updates.
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for SimpleHeaderlineHandle<S>
impl<S> !UnwindSafe for SimpleHeaderlineHandle<S>
impl<S> Freeze for SimpleHeaderlineHandle<S>
impl<S> Send for SimpleHeaderlineHandle<S>
impl<S> Sync for SimpleHeaderlineHandle<S>
impl<S> Unpin for SimpleHeaderlineHandle<S>
impl<S> UnsafeUnpin for SimpleHeaderlineHandle<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more