pub struct TimestampParts {
pub whole: Range<usize>,
pub date: Range<usize>,
pub value: NaiveDate,
pub weekday: Option<Range<usize>>,
pub repeater: Option<Repeater>,
pub active: bool,
}Expand description
A timestamp located token by token, for a caller that rewrites its date.
The ranges are byte offsets into the text the timestamp was found in, not into the timestamp itself, so an editor can splice a new date into the line it already holds. Everything the timestamp carries besides the date — the time, the repeater, the warning cookie — stays where it is, which is what makes moving a date a one-token edit.
Fields§
§whole: Range<usize>The whole timestamp, brackets included.
date: Range<usize>The YYYY-MM-DD date.
value: NaiveDateThe date that range parsed to.
weekday: Option<Range<usize>>The weekday token, when the timestamp carries one. Reported as written, in whatever language and length: a caller replacing the date is expected to keep both.
repeater: Option<Repeater>The repeater, when the timestamp carries one.
active: boolBracket form: true for active <...>, false for inactive [...].
Trait Implementations§
Source§impl Clone for TimestampParts
impl Clone for TimestampParts
Source§fn clone(&self) -> TimestampParts
fn clone(&self) -> TimestampParts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more