Expand description
A JSON Pointer index for line/column information within JSON and YAML content
§Example
The following loads YAML content into a structure that can be queried by JSON Pointer paths
ⓘ
use lincolns::{from_str, Position};
let positions = from_str(
r#"foo:
- bar: baz
boom: true
"#
)?;
assert_eq!(
positions.get("/foo/0/boom"),
Some(
&Position { line: 3, col: 6 }
)
);
assert_eq!(
positions.get("/foo/0/zoom"),
None
);Structs§
Enums§
- Error
- Possible errors that may occur while loading content
Functions§
- from_
reader - Load a lookup table of
Positioninformation from a type which implementsRead - from_
str - Load a lookup table of
Positioninformation from utf8 text