Skip to main content

state_for

Function state_for 

Source
pub fn state_for<S: Send + Sync + 'static>(
    ctx: &ActionContext<'_>,
) -> Option<Arc<Mutex<S>>>
Expand description

Look up this mode’s state for the buffer the action fired in.

Handle must be the same type used to register the service — ServiceRegistry keys on TypeId, so a mismatch silently returns None (see feedback_servicesregistry_arc_typeid). Each mode defines exactly one …StatesHandle alias and uses it for both.