pub struct Segment {
pub file_idx: u32,
pub scan_start: u32,
pub emit_start: u32,
pub emit_end: u32,
}Expand description
One scan window of a file.
All offsets are file-relative bytes. Invariant:
scan_start <= emit_start < emit_end and scan_start == emit_start - overlap
clamped at 0.
Fields§
§file_idx: u32Index into the file table this window belongs to.
scan_start: u32File-relative offset where scanning begins (DFA-state warm-up start).
emit_start: u32First file-relative offset this window OWNS: a match whose end offset is
in [emit_start, emit_end) is emitted here; an end < emit_start belongs
to the previous window’s owned region.
emit_end: u32Exclusive end of both the owned (emit) range and the scan range.
Implementations§
Source§impl Segment
impl Segment
Sourcepub const fn scan_len(&self) -> u32
pub const fn scan_len(&self) -> u32
Total bytes this window scans (warm-up prefix + owned region).
Sourcepub const fn abi_words(&self) -> [u32; 4]
pub const fn abi_words(&self) -> [u32; 4]
The device-ABI words for this segment, in the exact order the kernel
decodes them from segments[seg_idx * SEGMENT_WORDS ..]:
[file_idx, scan_start, emit_start, emit_end] (offsets file-relative
the kernel adds file_offsets[file_idx] to reach the packed haystack).
Trait Implementations§
impl Copy for Segment
impl Eq for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.