Crate lincolns

Source
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§

Position
Line and column position of content in a file
Positions
A table of Position information

Enums§

Error
Possible errors that may occur while loading content

Functions§

from_reader
Load a lookup table of Position information from a type which implements Read
from_str
Load a lookup table of Position information from utf8 text

Type Aliases§

Result