Enum jsonschema::paths::PathChunk [−][src]
Expand description
A key within a JSON object or an index within a JSON array. A sequence of chunks represents a valid path within a JSON value.
Example:
{
"cmd": ["ls", "-lh", "/home"]
}
To extract “/home” from the JSON object above, we need to take two steps:
- Go into property “cmd”. It corresponds to
PathChunk::Property("cmd".to_string())
. - Take the 2nd value from the array -
PathChunk::Index(2)
The primary purpose of this enum is to avoid converting indexes to strings during validation.
Variants
Property(String)
Property name within a JSON object.
Index(usize)
Index within a JSON array.
Keyword(&'static str)
JSON Schema keyword.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PathChunk
impl UnwindSafe for PathChunk
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more