Expand description
Types and traits for building JSON-based protocols and schemas
This crate provides the types and aliases that are used for the meta part of the protocol. This is the core annotation system as well as the dynamic value parts and the metadata that goes with it.
§Test Utilities
When the test
feature is enabled, this crate exposes the additional
assert_annotated_snapshot
macro. This can be used with insta
to render and compare snapshots
of annotated data with meta data.
Re-exports§
pub use self::condition::RuleCondition;
Modules§
- condition
- Types to specify conditions on data.
Macros§
- assert_
annotated_ snapshot - Asserts the snapshot of an annotated structure using
insta
. - derive_
string_ meta_ structure - Derives the
FromValue
,IntoValue
, andEmpty
traits using the string representation. - get_
path - Returns a reference to the typed
Annotated
value at a given path. - get_
value - Returns a reference to the typed value at a given path in an
Annotated
.
Structs§
- Annotated
- Wrapper for data fields with optional meta data.
- Arr
- Borrowed version of
Array
. - Deserializable
Annotated - An utility to de-serialize annotated objects with payload.
- Error
- An error with an enumerable kind and optional data.
- Getter
Iter - A type-erased iterator over a collection of
Getter
s. - Meta
- Meta information for a data field in the event payload.
- Meta
Tree - Represents a tree of meta objects.
- Obj
- Borrowed version of
Object
. - Remark
- Information on a modified section in a string.
- Serializable
Annotated - An utility to serialize annotated objects with payload.
- Value
Description - Helper type that renders out a description of the value.
Enums§
- Error
Kind - The kind of an
Error
. - Remark
Type - Gives an indication about the type of remark.
- Skip
Serialization - Defines behavior for skipping the serialization of fields.
- Val
- Borrowed version of
Value
. - Value
- Represents a boxed value.
Traits§
- Empty
- A value that can be empty.
- From
Object Ref - Implemented for all meta structures which can be created from an object.
- From
Value - Implemented for all meta structures.
- Getter
- A type that supports field access by paths.
- Into
Object Ref - Implemented for all meta structures which can be serialized into an object.
- Into
Value - Implemented for all meta structures.
Functions§
- estimate_
size - Estimates the size in bytes this would be in JSON.
- estimate_
size_ flat - Estimates the size in bytes this would be in JSON, but does not recurse into objects or arrays.
- to_
value - Convert
T
into aValue
.
Type Aliases§
- Array
- Alias for typed arrays.
- Map
- Alias for maps.
- MetaMap
- Meta for children.
- Object
- Alias for typed objects.
- Range
- The start (inclusive) and end (exclusive) indices of a
Remark
.