Module tags

Expand description

See tags for the system contract and examples. Bounded hierarchical tags for engine content and system filters. Tags are case-sensitive ASCII segments separated by dots. A stored child satisfies its parent query; render.mesh never matches render.meshes.

TagPredicate combines required (all), optional alternatives (any), and excluded (none) queries. Build and validate a predicate once, then match existing TagSet values without allocating:

use ferravex_engine::tags::{TagError, TagPredicate, TagSet};

let visible_actor = TagPredicate::default()
    .with_all(&["actor", "render.mesh"])?
    .with_any(&["team.friendly", "team.neutral"])?
    .with_none(&["state.hidden", "state.dead"])?;

let mut actor = TagSet::default();
for tag in ["actor.npc", "render.mesh.static", "team.friendly"] {
    actor.insert(tag)?;
}
assert!(visible_actor.matches(&actor));
actor.insert("state.hidden.cloaked")?;
assert!(!visible_actor.matches(&actor));

Structs§

TagPredicate
A validated conjunction of required/all, optional/any and excluded/none tags.
TagSet

Enums§

TagError