pub struct ParserTables {
pub schema_version: String,
pub format_version: String,
pub commands: Vec<CommandEntry>,
pub opcode_trie: Option<OpcodeTrieNode>,
/* private fields */
}Expand description
Re-exported spec table types used by the parser and validator. Top-level container for all ZPL command spec tables.
Deserialized from the generated JSON spec and used by the parser and validator for command recognition, argument parsing, and constraint checking.
Fields§
§schema_version: StringSpec schema version (e.g., "1.1.1").
format_version: StringTable format version for compatibility checks.
commands: Vec<CommandEntry>All known command entries.
opcode_trie: Option<OpcodeTrieNode>Optional opcode trie for fast longest-match command recognition.
Implementations§
Source§impl ParserTables
impl ParserTables
Sourcepub fn new(
schema_version: String,
format_version: String,
commands: Vec<CommandEntry>,
opcode_trie: Option<OpcodeTrieNode>,
) -> ParserTables
pub fn new( schema_version: String, format_version: String, commands: Vec<CommandEntry>, opcode_trie: Option<OpcodeTrieNode>, ) -> ParserTables
Create a new ParserTables with the given fields.
Cache fields are initialized lazily on first access.
Sourcepub fn code_set(&self) -> &HashSet<String>
pub fn code_set(&self) -> &HashSet<String>
Returns a cached set of all known command codes. The set is built lazily on first access and reused thereafter.
Sourcepub fn cmd_by_code(&self, code: &str) -> Option<&CommandEntry>
pub fn cmd_by_code(&self, code: &str) -> Option<&CommandEntry>
Look up a CommandEntry by its opcode string (e.g., “^FO”, “~DG”).
Uses a cached HashMap for O(1) lookup.
Trait Implementations§
Source§impl Clone for ParserTables
impl Clone for ParserTables
Source§fn clone(&self) -> ParserTables
fn clone(&self) -> ParserTables
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 ParserTables
impl Debug for ParserTables
Source§impl<'de> Deserialize<'de> for ParserTables
impl<'de> Deserialize<'de> for ParserTables
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParserTables, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParserTables, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ParserTables
impl Serialize for ParserTables
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl !Freeze for ParserTables
impl RefUnwindSafe for ParserTables
impl Send for ParserTables
impl Sync for ParserTables
impl Unpin for ParserTables
impl UnwindSafe for ParserTables
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