pub struct StrictOrDecoderRecognizer { /* private fields */ }Expand description
Recognizer that runs the strict path first and falls back to the decoder when the strict parse yields no meaningful attributes.
Default recognizer installed by crate::Engine::new. Callers
that need strict-only dispatch (the SC-001 interactive-latency
benchmark, tests asserting strict behavior) install
StrictRecognizer explicitly via
crate::Engine::with_recognizer.
Within this recognizer, dispatch is keyed off
ParseContext::strict_evidence:
strict_evidence = true: collapse to strict-only behavior. The decoder is not called. The engine never sets this; it’s reserved for callers (e.g., test code) that construct aParseContextdirectly and want to drive only the strict half of the dispatcher.strict_evidence = false(the engine default): try strict first. Fall back to the decoder when the strict result is either (a) zero-candidateAmbiguousor (b)Unambiguouswith an empty / trivialCapcoMarking(no classification, no SCI, no dissem, no FGI, etc.). The trivial-Unambiguous case matters becausemarque_core::Parseris lenient: it accepts arbitraryBYTES//BYTESshapes and returnsOkwith an emptyIsmAttributeswhen nothing in the input is a recognized CVE token. Treating such a result as a successful parse would leave the decoder dormant on exactly the mangled inputs it exists to recover (SERCET//NOFORN,NOFORN//SECRET, …). Strict is always called withstrict_evidence = trueinternally; the decoder is always called withstrict_evidence = falseinternally.
Other ParseContext fields (zone, position,
classification_floor) pass through unchanged.
Implementations§
Trait Implementations§
Source§impl Clone for StrictOrDecoderRecognizer
impl Clone for StrictOrDecoderRecognizer
Source§fn clone(&self) -> StrictOrDecoderRecognizer
fn clone(&self) -> StrictOrDecoderRecognizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StrictOrDecoderRecognizer
impl Debug for StrictOrDecoderRecognizer
Source§impl Default for StrictOrDecoderRecognizer
impl Default for StrictOrDecoderRecognizer
Source§fn default() -> StrictOrDecoderRecognizer
fn default() -> StrictOrDecoderRecognizer
Returns the “default value” for a type. Read more
Source§impl Recognizer<CapcoScheme> for StrictOrDecoderRecognizer
impl Recognizer<CapcoScheme> for StrictOrDecoderRecognizer
Source§fn recognize(&self, bytes: &[u8], cx: &ParseContext) -> Parsed<CapcoMarking>
fn recognize(&self, bytes: &[u8], cx: &ParseContext) -> Parsed<CapcoMarking>
Recognize a marking from raw bytes. Read more
impl Copy for StrictOrDecoderRecognizer
Auto Trait Implementations§
impl Freeze for StrictOrDecoderRecognizer
impl RefUnwindSafe for StrictOrDecoderRecognizer
impl Send for StrictOrDecoderRecognizer
impl Sync for StrictOrDecoderRecognizer
impl Unpin for StrictOrDecoderRecognizer
impl UnsafeUnpin for StrictOrDecoderRecognizer
impl UnwindSafe for StrictOrDecoderRecognizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more