Skip to main content

on_entity_with

Function on_entity_with 

Source
pub fn on_entity_with<V, P, O, F>(
    entity: &Entity<V>,
    f: F,
) -> OnUi<impl Fn(P, &mut App) -> Result<O, ActionError> + Send + Sync + 'static>
where V: 'static, P: for<'de> Deserialize<'de> + Send + 'static, O: Into<Outcome> + Send + 'static, F: Fn(P, &mut V, &mut Context<'_, V>) -> Result<O, ActionError> + Send + Sync + 'static,
Expand description

Like on_entity, but the action takes a typed parameter P (builds on on_ui(|p, cx|)). Declare the schema with ActionBuilder::params.