Skip to main content

validate

Function validate 

Source
pub fn validate(segments: &[Segment], text: &str) -> Result<(), String>
Expand description

Checks that segments address text cleanly.

Every offset must land on a UTF-8 character boundary within the text, spans must be half-open with start <= end, boundaries must be zero-width, and records must be ordered by start, then end.