Debian Codegraph @

debian/missing-sources/nom_locate/FAQ.md

raw symbols SCIP
1 # FAQ
2
3 ## How to use `LocatedSpan` with my own input type?
4
5 `LocatedSpan` has been designed to wrap any input type. By default it wraps `&str` and `&[u8]` but it should work with any other types.
6
7 To do so, all you need is to ensure that your input type implements these traits:
8 - `nom::Input`
9 - `nom::Compare`
10 - `nom::Offset`
11 - `nom::CompareResult`
12 - `nom::FindSubstring`
13 - `nom::ParseTo`
14 - `nom::AsBytes`
15
16 And ensure that what represents a char in your input type implements `nom::FindToken`.
17
18 Then you may use all the `impl_*` macros exposed by the library (see the [crate documentation](https://docs.rs/nom_locate/)).
19
20 ## `get_column` is not accurate
21
22 Your input probably doesn't have ASCII characters only. You'd probably better use `get_column_utf8` when your input is contains UTF-8 extensions, having in mind that it is much slower.
23
24