Skip to main content

control_meaning

Function control_meaning 

Source
pub fn control_meaning(token: &[u8]) -> Option<ControlMeaning>
Expand description

What: The meaning of a token that is exactly a control spelling, or nothing. &[u8] borrows raw bytes; Option<T> is “a value or nothing”. Why: Arguments are compared as bytes, so a non-UTF-8 argument is never decoded.

In TS you’d write (pseudocode):

const meaning = CONTROL_SPELLINGS.find(s => s.flag === token)?.meaning;