pub struct RuleResult<'a> {
pub complete_input: &'a str,
pub ranges: Vec<UsizeRange>,
pub discovered: Vec<&'a str>,
}Expand description
规则执行完成后的最终提取结果。
该结构体由 State 转换而来,除了保留索引范围外,
还会实际切片提取出对应的字符串片段。
Fields§
§complete_input: &'a str原始的完整输入文本。
ranges: Vec<UsizeRange>最终命中的所有文本范围。
discovered: Vec<&'a str>根据 ranges 从 complete_input 中切片提取出的实际文本内容。
Trait Implementations§
Source§impl<'a> Debug for RuleResult<'a>
impl<'a> Debug for RuleResult<'a>
Auto Trait Implementations§
impl<'a> Freeze for RuleResult<'a>
impl<'a> RefUnwindSafe for RuleResult<'a>
impl<'a> Send for RuleResult<'a>
impl<'a> Sync for RuleResult<'a>
impl<'a> Unpin for RuleResult<'a>
impl<'a> UnsafeUnpin for RuleResult<'a>
impl<'a> UnwindSafe for RuleResult<'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