pub struct ParsedResult {
pub ref_date: DateTime<Local>,
pub index: usize,
pub end_index: usize,
pub text: String,
pub start: FastComponents,
pub end: Option<FastComponents>,
}Expand description
A parsed result representing a matched date/time expression.
Fields§
§ref_date: DateTime<Local>Reference date used while resolving this result.
index: usizeStart byte index of the matched text.
end_index: usizeEnd byte index of the matched text.
text: StringOriginal text slice that produced this result.
start: FastComponentsParsed components for the start of the match.
end: Option<FastComponents>Parsed components for the end of the match, when the result is a range.
Implementations§
Source§impl ParsedResult
impl ParsedResult
Sourcepub fn new(
reference: &ReferenceWithTimezone,
index: usize,
text: impl Into<String>,
start: FastComponents,
end: Option<FastComponents>,
) -> Self
pub fn new( reference: &ReferenceWithTimezone, index: usize, text: impl Into<String>, start: FastComponents, end: Option<FastComponents>, ) -> Self
Create a parsed result from a matched slice and component set.
Trait Implementations§
Source§impl Clone for ParsedResult
impl Clone for ParsedResult
Source§fn clone(&self) -> ParsedResult
fn clone(&self) -> ParsedResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParsedResult
impl RefUnwindSafe for ParsedResult
impl Send for ParsedResult
impl Sync for ParsedResult
impl Unpin for ParsedResult
impl UnsafeUnpin for ParsedResult
impl UnwindSafe for ParsedResult
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