Skip to main content

StateQuery

Trait StateQuery 

Source
pub trait StateQuery {
    // Required method
    fn in_state(&self, id: &str) -> bool;

    // Provided method
    fn active_states(&self) -> Option<Vec<String>> { ... }
}
Expand description

Answers the In(stateId) predicate against the current configuration.

Required Methods§

Source

fn in_state(&self, id: &str) -> bool

True exactly when the state with this identifier is active.

Provided Methods§

Source

fn active_states(&self) -> Option<Vec<String>>

The identifiers of every active state in document order, when the caller can list them. Datamodels that must answer In() from a callback they cannot borrow (such as an embedded engine’s native function) copy this before evaluating; None means only StateQuery::in_state is available.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§