Crate query_range

Source
Expand description

§Query Range Iterator

This package provides an iterator (conforming to Iterator) which finds all ranges of a query within the searched content. The iterator can be collected, mapped or used manually (by calling the next() method until no further result is returned).

This also exports several range utilities for use with strings.

Modules§

utility

Structs§

QueryRangeItr
Iterates all found query within given content.

Enums§

Shift
Enum to specify the direction of a shift, up or down with amount (magnitude).

Functions§

get_range
Gets first range of given query in given content.
is_within
Checks if a closed range exists in given string content.
shift_range
Creates a new range with the start and end values shifted by the given amount.
shift_range_in_content
Creates a new range with the start and end values shifted by the given amount and checks that the range is valid in the given content. If new range falls outside of the given content, None will be returned.
to_title_case
Converts a string to title case (first letter capitalized and all the rest lower-case).