pub trait BinaryPattern:
Send
+ Sync
+ Debug {
// Required methods
fn atoms(&self) -> &[Atom];
fn byte_sequence(&self) -> &[u8];
// Provided methods
fn save_len(&self) -> usize { ... }
fn cursor_len(&self) -> usize { ... }
}Expand description
A binary pattern is a structure used in matching processes and consists of two main components:
-
Atoms
A list of instructions or actions that define how the matcher should process the data at the current cursor. -
Byte Sequence
A sequence of bytes that the atoms can reference to match against actual input data.
Required Methods§
Sourcefn atoms(&self) -> &[Atom]
fn atoms(&self) -> &[Atom]
Retrieves the list of atoms within this binary pattern.
The atoms define the actions or matching logic for the pattern.
Sourcefn byte_sequence(&self) -> &[u8]
fn byte_sequence(&self) -> &[u8]
Retrieves the byte sequence referenced by the atoms.
This sequence represents the actual data to be matched against.
Provided Methods§
Sourcefn save_len(&self) -> usize
fn save_len(&self) -> usize
Returns an upper bound for the length of the save stack.
§Note
This is only an upper bound. The actual length used might be smaller.
Sourcefn cursor_len(&self) -> usize
fn cursor_len(&self) -> usize
Returns an upper bound for the length of the cursor stack.
§Note
This is only an upper bound. The actual length used might be smaller.