Skip to main content

IsmAttributes

Struct IsmAttributes 

Source
#[non_exhaustive]
pub struct IsmAttributes {
Show 13 fields pub classification: Option<MarkingClassification>, pub sci_controls: Box<[SciControl]>, pub sar_identifiers: Box<[SarIdentifier]>, 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<[Trigraph]>, pub declassify_on: Option<Box<str>>, 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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.

§sar_identifiers: Box<[SarIdentifier]>

Special Access Required identifiers.

§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<[Trigraph]>

REL TO country trigraphs. USA must be present and first if non-empty.

Structurally part of the dissem block (comma-delimited), but kept as a typed field for E002 and REL TO validation rules.

§declassify_on: Option<Box<str>>

Declassification date from CAB (free text, e.g., “20331231”).

§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

Source

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

Source§

fn clone(&self) -> IsmAttributes

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IsmAttributes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IsmAttributes

Source§

fn default() -> IsmAttributes

Returns the “default value” for a type. Read more
Source§

impl PartialEq for IsmAttributes

Source§

fn eq(&self, other: &IsmAttributes) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for IsmAttributes

Source§

impl StructuralPartialEq for IsmAttributes

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.