Files
ARCADIA-Studio/crates/oa-desktop/src/semantic_review/message_kind.rs
T

25 lines
789 B
Rust

//! The first supported constructor group is the closed nested MessageKind.
//! The core owns its acknowledgment/retirement and validation policies.
use super::*;
pub(super) fn selector() -> FacetSelector {
FacetSelector::Occurrence(OccurrenceFacet::MessageKind)
}
#[cfg(test)]
pub(super) fn timer_selector() -> FacetSelector {
FacetSelector::Occurrence(OccurrenceFacet::TimerExpression)
}
pub(super) fn handles(facet: &FacetSelector) -> bool {
*facet == selector()
}
#[cfg(test)]
pub(super) fn value(project: &Project, id: Id) -> Option<&MessageKind> {
match project.elements.get(&id)?.shared()? {
SharedBody::Occurrence {
body: OccurrenceBody::Exchange { message_kind, .. },
..
} => Some(message_kind),
_ => None,
}
}