1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Trait definitions for pattern matching backends.
//!
//! These traits define the polymorphic interface that enables zero-cost
//! backend swaps (CPU, GPU, SIMD, multi-GPU) without consumer code changes.
//!
//! # Architecture
//!
//! ```text
//! Matcher (async scan)
//! ├── CpuMatcher (Aho-Corasick + regex)
//! ├── GpuMatcher (wgpu compute shaders)
//! ├── AutoMatcher (routes by input size)
//! └── MultiGpuMatcher (parallel GPU dispatch)
//!
//! BlockMatcher (scan + max_block_size)
//! └── Used for streaming/chunked scanning
//! ```
use crateResult;
use crateMatch;
/// General trait for pattern matching across any backend.
///
/// Implementations must be `Send + Sync` to support concurrent scanning
/// across multiple threads or async tasks.
///
/// # Example
///
/// ```rust,ignore
/// use matchkit::{Matcher, Match};
///
/// async fn search(matcher: &dyn Matcher, data: &[u8]) {
/// let matches = matcher.scan(data).await.unwrap();
/// for m in matches {
/// println!("pattern {} matched at {}..{}", m.pattern_id, m.start, m.end);
/// }
/// }
/// ```
/// Dynamic trait object type for matchers when generic boxing is required.
pub type BoxedMatcher = ;
/// Block-based matching for large continuous scans bounded by memory.
///
/// Implementations advertise their maximum block size so callers can
/// chunk input appropriately for streaming pipelines.