pub struct State<'a> {
pub input: &'a str,
pub ranges: Vec<UsizeRange>,
}Expand description
规则执行过程中的中间状态。
随着规则流(flow)的执行,ranges 可能会被修改、过滤或新增,
最终通过的所有 ranges 将作为命中的结果。
Fields§
§input: &'a str待分析的原始输入文本。
ranges: Vec<UsizeRange>当前阶段捕获到的文本范围集合。
Implementations§
Trait Implementations§
Source§impl<'a> From<State<'a>> for RuleResult<'a>
impl<'a> From<State<'a>> for RuleResult<'a>
Auto Trait Implementations§
impl<'a> Freeze for State<'a>
impl<'a> RefUnwindSafe for State<'a>
impl<'a> Send for State<'a>
impl<'a> Sync for State<'a>
impl<'a> Unpin for State<'a>
impl<'a> UnsafeUnpin for State<'a>
impl<'a> UnwindSafe for State<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more