TextSegments
Owns allocation-free traversal state for borrowed fields or lines.
Module std.text
import std.text;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
TextSegments
pub final class TextSegmentsOwns allocation-free traversal state for borrowed fields or lines.
Each yielded str borrows the original backing storage. Copying traversal state retains no owner. Split search is ordinal with O(n*m) worst-case work; line scanning visits bytes once. All returned slice endpoints are UTF-8 boundaries.
TextSegments.CreateIterator
pub readonly fn CreateIterator() -> TextSegmentsCreates an independent cursor at the current traversal position. Return: Copy of traversal state borrowing the same source and separator storage. Warning: Advancing either cursor does not extend backing storage lifetime.
TextSegments.Next
pub fn Next() -> str?Advances once and borrows the next field or unterminated line content. Return: Next borrowed str, including admitted empty items, or none after exhaustion. Warning: Backing source and separator storage must remain live and unchanged.