bmatcher_core

Trait BinaryPattern

Source
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:

  1. Atoms
    A list of instructions or actions that define how the matcher should process the data at the current cursor.

  2. Byte Sequence
    A sequence of bytes that the atoms can reference to match against actual input data.

Required Methods§

Source

fn atoms(&self) -> &[Atom]

Retrieves the list of atoms within this binary pattern.

The atoms define the actions or matching logic for the pattern.

Source

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§

Source

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.

Source

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.

Implementors§