Struct stringsext::helper::SplitStrResult [−][src]
pub struct SplitStrResult<'a> {
pub s: &'a str,
pub s_completes_previous_s: bool,
pub s_is_maybe_cut: bool,
pub s_is_to_be_filtered_again: bool,
pub s_satisfies_grep_char_rule: bool,
pub s_satisfies_min_char_rule: bool,
}
Expand description
This enum describes result variants of the SplitStr::next()
output.
Fields
s: &'a str
s
is the main item of the iterator’s output. It holds the current
substring that satisfied all filter criteria. It comes with additional
information describing its potential use delivered by the following
flags.
s_completes_previous_s: bool
The returned substring was found starting at the left buffer boundary. As
the iterator was informed at the beginning, that the last found s
in
the previous inp
buffer was of type s_is_maybe_cut
, we indicate that
this returned substring completes the previous one from last run.
s_is_maybe_cut: bool
The returned substring &str
touches the right inp
-buffer boundary and
therefor is eventually cut. We will only find out during the next
run. We will check if the first characters from the future inp
-buffer
eventually complete this substring. The flag is also true, when a
substring was intentionally cut by this iterator itself. He does so
when he considerss
to be too long to be printed in one go.
s_is_to_be_filtered_again: bool
The returned string was found at the right buffer boundary and is
considered to be too short to be printed in this run. Instead, it
will be temporarily stored and then inserted at the beginning of the next
inp
-buffer.
s_satisfies_grep_char_rule: bool
This flag is true
when the returned s
has at least chars_min_nb
characters.
Usually the iterator always observes this minimum-rule, but there are
some exceptions: e.g. with
last_s_was_maybe_cut
set, we can instruct the iterator to make such an
exception. When he does, he sets also flag, so the caller can know.
s_satisfies_min_char_rule: bool
This flag is true
when the returned s
has at least one
ASCII with code grep_char
.
Usually the iterator always observes this grep_char-rule, but there are
some exceptions: e.g. with
last_s_was_maybe_cut
set, we can instruct the iterator to make such an
exception. When he does, he sets also flag, so the caller can know.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.