Expand description
Syntax of JSON-LD contexts.
This crate provides the Rust types mirroring the JSON-LD grammar of a
@context: context definitions, term definitions, keywords, container
mappings, language tags and text directions. Each of them can be built
from a JSON value with TryFromJson, converted back with IntoJson,
and pretty-printed with the Print trait re-exported from jstrict.
Interpreting a context — resolving remote references, expanding terms into
IRIs, compacting IRIs back into terms — is the job of the sibling
jsonld-context-processing, jsonld-expansion and jsonld-compaction
crates.
Re-exports§
pub use container::Container;pub use container::ContainerKind;pub use context::Context;pub use context::ContextDocument;pub use context::ContextEntry;
Modules§
- container
- Container mappings: the values a
@containerentry may take. - context
- Contexts, their definitions and term definitions.
- hash
- Workspace-wide hasher selection.
- intern
- Process-wide string interner used by
crate::context::definition::Key. - native_
stack - Keeping the recursion of the JSON-LD algorithms off the caller’s native stack.
- object
- JSON objects.
- parse
- JSON parsing.
- JSON printing.
Structs§
- Compact
Iri - Compact IRI: a prefix and a suffix separated by a colon.
- Compact
IriBuf - Owned compact IRI.
- Invalid
Compact Iri - Error raised when a string is not a compact IRI.
- Invalid
Direction - Error raised when a string is neither
ltrnorrtl. - Invalid
Lang Tag - Invalid langtag error.
- Keyword
Type - The
@typekeyword, as a type of its own. - LangTag
- Any language tag (normal, private use or grandfathered).
- Lang
TagBuf - Owned langtag.
- Lenient
Lang Tag - Language tag that may not be well-formed.
- Lenient
Lang TagBuf - Owned language tag that may not be well-formed.
- NotA
Keyword - Error raised when a string is not a JSON-LD keyword.
- Null
Error - Error returned by
Nullable::try_unwrapwhen the value isnull. - Number
- Lexical JSON number.
- Object
- Object.
- Unexpected
- Error raised when a JSON value has the wrong kind.
- Unordered
- Wrapper to view a value without considering the order of the objects entries.
Enums§
- Direction
- Internationalized string direction.
- Error
Code - JSON-LD error code.
- Expandable
Ref - Borrowed value that IRI expansion can be applied to.
- Keyword
- JSON-LD keywords.
- Kind
- Value kind.
- Nullable
- Value that can be
null. - Value
- JSON Value.
Traits§
- Borrow
Unordered - Free conversion from
&Tto&Unordered<T>. - Compare
- Comparison ignoring the order of array items and object entries.
- Into
Json - Values convertible into JSON.
- Into
Json With Context - Values convertible into JSON through a vocabulary.
- Parse
- JSON parsing methods.
- Print methods.
- TryFrom
Json - Values that can be built from a JSON value.
- Unordered
Eq - Marker trait stating that
UnorderedPartialEqis an equivalence relation, mirroringEqoverPartialEq. - Unordered
Hash - Hashing that ignores the order of object entries.
- Unordered
Partial Eq - Equality that ignores the order of object entries.
Functions§
- from_
value serde - Deserializes the JSON
valueinto an instance of typeT. - is_
keyword - Checks whether the given string is one of the JSON-LD keywords.
- is_
keyword_ like - Checks whether the given string is keyword-like: an
@followed by one or more ASCII letters. - to_
value serde - Serializes the given
valueinto a JSONValue.