pub struct ParsingContext {
pub text: String,
pub option: ParsingOption,
pub reference: ReferenceWithTimezone,
pub ref_date: JsDate,
}Expand description
upstream ParsingContext.
Fields§
§text: String§option: ParsingOption§reference: ReferenceWithTimezone§ref_date: JsDateDeprecated upstream alias of reference.instant; parsers still read it.
Implementations§
Source§impl ParsingContext
impl ParsingContext
Sourcepub fn new(
text: &str,
reference: &ReferenceInput,
option: ParsingOption,
now: JsDate,
) -> ParsingContext
pub fn new( text: &str, reference: &ReferenceInput, option: ParsingOption, now: JsDate, ) -> ParsingContext
new ParsingContext(text, refDate, option). now stands in for new Date().
Sourcepub fn create_parsing_components(
&self,
known: &[(Component, i64)],
) -> ParsingComponents
pub fn create_parsing_components( &self, known: &[(Component, i64)], ) -> ParsingComponents
createParsingComponents(components).
Sourcepub fn create_parsing_result(
&self,
index: usize,
text: impl Into<String>,
start: Option<ParsingComponents>,
end: Option<ParsingComponents>,
) -> ParsingResult
pub fn create_parsing_result( &self, index: usize, text: impl Into<String>, start: Option<ParsingComponents>, end: Option<ParsingComponents>, ) -> ParsingResult
createParsingResult(index, text, start?, end?).
Sourcepub fn create_parsing_result_to(
&self,
index: usize,
end_index: usize,
start: Option<ParsingComponents>,
end: Option<ParsingComponents>,
) -> ParsingResult
pub fn create_parsing_result_to( &self, index: usize, end_index: usize, start: Option<ParsingComponents>, end: Option<ParsingComponents>, ) -> ParsingResult
createParsingResult(index, endIndex, ...): the text is context.text.substring(index, endIndex).
Trait Implementations§
Source§impl Clone for ParsingContext
impl Clone for ParsingContext
Auto Trait Implementations§
impl Forget for ParsingContext
impl Freeze for ParsingContext
impl RefUnwindSafe for ParsingContext
impl Send for ParsingContext
impl Sync for ParsingContext
impl Unpin for ParsingContext
impl UnsafeUnpin for ParsingContext
impl UnwindSafe for ParsingContext
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