dig
Types
wrap dynamic.Decoder
with a path
pub type DigDecoder {
DigObject(path: List(String), inner: Decoder(Dynamic))
DigList(path: List(String), inner: Decoder(List(Dynamic)))
}
Constructors
-
DigObject(path: List(String), inner: Decoder(Dynamic))
-
DigList(path: List(String), inner: Decoder(List(Dynamic)))
pub type DigError {
EmptyPath
ParsePath(inner: PathSegParseError)
}
Constructors
-
EmptyPath
-
ParsePath(inner: PathSegParseError)
pub type PathSeg {
Object(key: String)
List(key: Option(String), index: Option(Int))
}
Constructors
-
Object(key: String)
-
List(key: Option(String), index: Option(Int))
pub type PathSegParseError {
InvalidPathSeg(path_seg: String)
}
Constructors
-
InvalidPathSeg(path_seg: String)
pub type PathSegParseResult =
Result(PathSeg, PathSegParseError)
Functions
pub fn dig_path_seg(
path_seg: String,
) -> Result(DigDecoder, DigError)
dig dynamic.Decoder
in single path segment
pub fn parse_path_seg(
path_seg: String,
) -> Result(PathSeg, PathSegParseError)
parse single path segment