Available on crate feature
blob only.Expand description
Modified for gitoxide from the upstream imara-diff crate. Upstream source: git cat-file -p 32d1e45d3df061e6ccba6db7fdce92db29e345d8:src/sources.rs
Utilities for creating token sources from common data types.
This module provides implementations of TokenSource for
strings and byte slices, splitting them into lines by default.
Structs§
- BStr
Lines - A
TokenSourcethat returns the lines of aBStras tokens. Seebstr_linesfor details. - Byte
Lines - A
TokenSourcethat returns the lines of a byte slice as tokens. Seebyte_linesfor details. - Lines
- A
TokenSourcethat returns the lines of astras tokens. Seelinesfor details. - Words
- A
TokenSourcethat returns the words of a string as tokens. Seewordsfor details.
Functions§
- bstr_
lines - Returns a
TokenSourcethat uses the lines indataas Tokens. The newline separator (\r\nor\n) is included in the emitted tokens. This means that changing the newline separator from\r\nto\n(or omitting it fully on the last line) is detected when computing aDiff. - byte_
lines - Returns a
TokenSourcethat uses the lines indataas Tokens. The newline separator (\r\nor\n) is included in the emitted tokens. This means that changing the newline separator from\r\nto\n(or omitting it fully on the last line) is detected when computing aDiff. - lines
- Returns a
TokenSourcethat uses the lines indataas Tokens. The newline separator (\r\nor\n) is included in the emitted tokens. This means that changing the newline separator from\r\nto\n(or omitting it fully on the last line) is detected byDiff. - words
- Returns a
TokenSourcethat uses the words indataas Tokens. A word is a sequence of alphanumeric characters as determined bychar::is_alphanumeric, or a sequence of just the space character ’ ’. Any other characters are their own word.