Skip to main content

RafClosureCell

Type Alias RafClosureCell 

Source
pub type RafClosureCell = Rc<MaybeEngineCell<Closure<dyn FnMut()>>>;
Expand description

A reference-counted requestAnimationFrame closure cell.

Holds an Option<Closure<dyn FnMut()>> behind MaybeEngineCell so the cell may legitimately be empty (no closure installed) before spawn is called and after cleanup tears it down. Mirrors core::reactive::schedule::static::CURRENT_HOOK_CONTEXT in shape.

§Access

Use MaybeEngineCell::try_get_mut for absent-or-present read, MaybeEngineCell::try_set to install, MaybeEngineCell::try_take to remove.

Aliased Type§

pub struct RafClosureCell { /* private fields */ }