Skip to main content

should_rewrite_entity

Attribute Macro should_rewrite_entity 

Source
#[should_rewrite_entity]
Expand description

Filters which entities enter the entity field rewrite path.

Return false to skip all entity-field replacement callbacks for that entity. Use this to keep broad #[rewrite_field] handlers from forcing the writer to decode and re-encode unrelated entity classes.

The handler can receive ctx: &Context, event: EntityEvents, and entity: &Entity in any order. Return bool.