pub struct PathLayer { /* private fields */ }Expand description
A layer that tracks the current Path in the state.
The layer works for serialization (it implements
deser::ser::Layer) and deserialization (it implements
deser::de::Layer). It attaches the path to errors which do not have
one (see Error::attachment).
During deserialization the path is also correct for values which are buffered and replayed (for instance by internally tagged enums).
Layers see the path of the current event if they are added after the path layer. This also means that the errors of such layers get the path of the event they reject attached, so the path layer should typically be added first.
Implementations§
Trait Implementations§
Source§impl Layer for PathLayer
Tracks the path during deserialization.
impl Layer for PathLayer
Tracks the path during deserialization.
The path of a value is set before the value is passed on, so that the sinks can access it. Containers push a segment for their items after they started and pop it before they end, so the path of a container is its own path while it’s finished.
Source§impl Layer for PathLayer
Tracks the path during serialization.
impl Layer for PathLayer
Tracks the path during serialization.
The format receives the events with the path of the value they belong
to (map keys with the path of the map). After an event was passed on,
the path is updated for the value that follows, so that its
Serialize implementation can access it.