wahgex_core/runtime.rs
1//! TODO: Write docs for this module
2
3/// TODO: Wrote docs for this item
4#[derive(Debug, zerocopy::KnownLayout, zerocopy::Immutable, zerocopy::FromZeros)]
5#[repr(C)]
6pub struct MatchResultHeader {
7 /// Set to `true` if the regex found a match in the haystack.
8 ///
9 /// If `false`, other fields in this struct may not be valid.
10 pub is_match: bool,
11}
12
13#[cfg(test)]
14mod tests {
15 use std::alloc::Layout;
16
17 use super::*;
18
19 #[test]
20 fn run_result_layout() {
21 assert_eq!(
22 Layout::new::<MatchResultHeader>(),
23 Layout::from_size_align(1, 1).unwrap()
24 )
25 }
26}