#[non_exhaustive]pub struct IsmAttributes {Show 14 fields
pub classification: Option<MarkingClassification>,
pub sci_controls: Box<[SciControl]>,
pub sci_markings: Box<[SciMarking]>,
pub sar_markings: Option<SarMarking>,
pub aea_markings: Box<[AeaMarking]>,
pub fgi_marker: Option<FgiMarker>,
pub dissem_controls: Box<[DissemControl]>,
pub non_ic_dissem: Box<[NonIcDissem]>,
pub rel_to: Box<[CountryCode]>,
pub declassify_on: Option<IsmDate>,
pub classified_by: Option<Box<str>>,
pub derived_from: Option<Box<str>>,
pub declass_exemption: Option<DeclassExemption>,
pub token_spans: Box<[TokenSpan]>,
}Expand description
Canonical in-memory representation of a classification marking.
Produced by marque-core::parser from scanner candidates.
Consumed by marque-rules::Rule implementations for validation.
§Block ordering (CAPCO)
Fields are ordered per CAPCO block sequence: Classification → SCI → SAR → FGI marker → Dissem (incl. REL TO)
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.classification: Option<MarkingClassification>The marking’s classification system and level.
None means parsing failed to identify a classification.
sci_controls: Box<[SciControl]>SCI controls (e.g., SI, TK, HCS-P). Ordered per CAPCO block ordering.
This is the enum projection populated by the parser’s CVE exact-match
path. Retained for back-compat with existing rules (E010, E011). New
rules that need compartment / sub-compartment structure should read
IsmAttributes::sci_markings instead.
sci_markings: Box<[SciMarking]>Structural view of SCI category-block entries.
Each entry corresponds to one /-separated marking within an SCI
category block (e.g., //SI-G/TK-BLFH// yields two SciMarking
entries). Populated alongside sci_controls; sci_markings is the
authoritative source for rules that inspect compartments or
sub-compartments. See spec 003-sci-compartments.
sar_markings: Option<SarMarking>Special Access Required block, if present. Only one SAR block is
permitted per marking per §A.6; cardinality is Option, not Vec.
See SarMarking for the structural representation.
aea_markings: Box<[AeaMarking]>Atomic Energy Act markings (CAPCO Register §6).
Includes RD, FRD, CNWDI, TFNI, SIGMA, and UCNI variants. Positioned between SAR and FGI in CAPCO block ordering.
fgi_marker: Option<FgiMarker>FGI block in US-classified markings: FGI or FGI [LIST].
Present when a US-classified document references foreign government
information. This is the marker in the banner/portion — distinct
from MarkingClassification::Fgi, which means the marking IS
foreign-classified.
None when no FGI marker is present.
dissem_controls: Box<[DissemControl]>Dissemination controls (e.g., NOFORN, RELIDO, ORCON, FISA).
non_ic_dissem: Box<[NonIcDissem]>Non-IC dissemination controls (e.g., LIMDIS, SBU, LES, SSI).
Separate authority framework (CAPCO Register §9), distinct from IC
dissem controls. In classified documents these are generally portion-
only and stripped from banners, but some values propagate to the
classified banner; see NonIcDissem::propagates_to_classified_banner
for the authoritative rule. On unclassified pages they propagate to
the banner. LES-NF and SBU-NF carry NOFORN treatment even when
stripped.
rel_to: Box<[CountryCode]>REL TO country / country-group codes. USA must be present and first when the marking targets a US release.
Holds the full CAPCO country-code surface — trigraphs (USA,
GBR), tetragraphs / country-group codes (FVEY, ACGU,
NATO, RSMA, …), and the longer registered codes (EU,
AUSTRALIA_GROUP). Tetragraph membership expansion (FVEY →
{AUS, CAN, GBR, NZL, USA}) happens at banner-roll-up time in
[PageContext::expected_rel_to], not at parse time, so this
list preserves the source vocabulary as written.
Structurally part of the dissem block (comma-delimited), but kept as a typed field for E002 and REL TO validation rules.
declassify_on: Option<IsmDate>Declassification date from CAB (ISM precision-tier union).
Typed as IsmDate to preserve the precision tier from the original
source. In CAPCO text markings the parser accepts:
YYYY(4-digit year →IsmDate::Year)YYYYMMDD(8-digit no-hyphen →IsmDate::Date)- ISO 8601 with hyphens (
YYYY-MM-DD, etc.) for XML-sourced markings.
Year(y) represents the entire calendar year — its end-of-span is
December 31 of year y, which is later than any date in that year.
Use IsmDate::end_cmp when determining the most-conservative
(furthest-out) date across portions.
classified_by: Option<Box<str>>Free-text “Classified By” identifier from CAB.
derived_from: Option<Box<str>>Free-text “Derived From” source from CAB.
declass_exemption: Option<DeclassExemption>Declassification exemption code from CAB (e.g., 25X1, 50X1-HUM).
token_spans: Box<[TokenSpan]>Per-token byte spans into the original source buffer, recorded by the parser as it walks the marking string. Phase 3 added this so rules can point at the exact offending byte range instead of the whole marking. Empty for CAB markings (CAB parsing is line-structured and doesn’t go through the token-walking path).
Indexing convention: token_spans is in document order. To find the
span for the Nth DissemControl, walk the slice and pick the Nth
entry whose kind == TokenKind::DissemControl.
Implementations§
Source§impl IsmAttributes
impl IsmAttributes
Sourcepub fn us_classification(&self) -> Option<Classification>
pub fn us_classification(&self) -> Option<Classification>
Convenience accessor: returns the US classification level if this marking uses the US or Conflict classification system.
Returns None for pure FGI, NATO, or JOINT markings (use
self.classification directly for those).
Trait Implementations§
Source§impl Clone for IsmAttributes
impl Clone for IsmAttributes
Source§fn clone(&self) -> IsmAttributes
fn clone(&self) -> IsmAttributes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more