Crate relay_protocol
source ·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§
- Types to specify conditions on data.
Macros§
- Asserts the snapshot of an annotated structure using
insta
. - Returns a reference to the typed
Annotated
value at a given path. - Returns a reference to the typed value at a given path in an
Annotated
.
Structs§
- Wrapper for data fields with optional meta data.
- Borrowed version of
Array
. - An error with an enumerable kind and optional data.
- A type-erased iterator over a collection of
Getter
s. - Meta information for a data field in the event payload.
- Represents a tree of meta objects.
- Borrowed version of
Object
. - Information on a modified section in a string.
- An utility to serialize annotated objects with payload.
- Helper type that renders out a description of the value.
Enums§
- The kind of an
Error
. - Gives an indication about the type of remark.
- Defines behavior for skipping the serialization of fields.
- Borrowed version of
Value
. - Represents a boxed value.
Traits§
- A value that can be empty.
- Implemented for all meta structures.
- A type that supports field access by paths.
- Implemented for all meta structures.
Functions§
- Estimates the size in bytes this would be in JSON.
- Estimates the size in bytes this would be in JSON, but does not recurse into objects or arrays.
- Convert
T
into aValue
.
Type Aliases§
- Alias for typed arrays.
- Alias for maps.
- Meta for children.
- Alias for typed objects.
- The start (inclusive) and end (exclusive) indices of a
Remark
.