pub struct StateMapping {
pub signal: StateSignal,
pub by_value: BTreeMap<String, StateCategory>,
pub default: StateCategory,
}Expand description
Resolves a provider’s raw status value to a normalized [StateCategory].
Fields§
§signal: StateSignalWhere the connector reads the raw status value from.
by_value: BTreeMap<String, StateCategory>Raw value (status name / label suffix / section name) → category.
default: StateCategoryCategory used when no by_value entry matches the raw value.
Implementations§
Source§impl StateMapping
impl StateMapping
Sourcepub fn category_of(&self, raw_value: &str) -> StateCategory
pub fn category_of(&self, raw_value: &str) -> StateCategory
Translate a raw status value to a normalized category, falling back to
StateMapping::default when nothing matches.
Matching prefers an exact key, then falls back to a case-insensitive
match — a board’s status/column names are unique within one field, so a
case-only variant (e.g. config "In Progress" vs board "In progress")
can never collide with a genuinely different column.
Sourcepub fn column_for(
&self,
category: StateCategory,
overrides: &BTreeMap<StateCategory, String>,
) -> Result<String, ReverseError>
pub fn column_for( &self, category: StateCategory, overrides: &BTreeMap<StateCategory, String>, ) -> Result<String, ReverseError>
Resolve a normalized category back to the board column name to write.
overrides (category→column) win outright. Otherwise the column is the
unique by_value key whose category equals category. The default
category is a read-time fallback only and is never a write target.
Trait Implementations§
Source§impl Clone for StateMapping
impl Clone for StateMapping
Source§fn clone(&self) -> StateMapping
fn clone(&self) -> StateMapping
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more