pub struct When {
pub due: String,
pub text: String,
pub start: usize,
pub end: usize,
}Expand description
A when found in a capture: what to pass to --due, and the exact span of
the original it was read from.
The span is what lets a surface render a dismissable chip and show which words produced it. Byte offsets into the input, so a caller can slice without re-searching and without assuming the token is unique — “tomorrow, and tell Bob tomorrow” has two, and only the one that was matched may be highlighted.
Fields§
§due: StringThe spelling to hand to the graph, always one parse_due accepts.
text: StringWhat the owner actually wrote, verbatim — the chip’s label.
start: usize§end: usizeTrait Implementations§
impl Eq for When
impl StructuralPartialEq for When
Auto Trait Implementations§
impl Freeze for When
impl RefUnwindSafe for When
impl Send for When
impl Sync for When
impl Unpin for When
impl UnsafeUnpin for When
impl UnwindSafe for When
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
Mutably borrows from an owned value. Read more