Expand description
Serialization public API is defined at crate root
Re-exports§
pub use de::Budget;pub use de::DuplicateKeyPolicy;pub use de::Options;pub use localizer::DefaultEnglishLocalizer;pub use localizer::ExternalMessage;pub use localizer::ExternalMessageSource;pub use localizer::Localizer;pub use localizer::DEFAULT_ENGLISH_LOCALIZER;pub use ser::Commented;pub use ser::FlowMap;pub use ser::FlowSeq;pub use ser::SpaceAfter;pub use ser::YamlSerializer as Serializer;
Modules§
- budget
- Streaming YAML budget checker using saphyr-parser.
- figment
- localizer
- Localization / wording customization.
- miette
mietteintegration.- options
- path_
map - This module records YAML key paths (as seen during deserialization) and later tries to map validation paths back to those YAML locations.
- robotics
- ser
- Single-pass YAML serializer with optional anchors for Rc/Arc/Weak, order preservation (uses the iterator order of your types), simple style controls (block strings & flow containers), and special float handling for NaN/±Inf. No intermediate YAML DOM is built.
- ser_
error
Macros§
- budget
- Construct
Some([crate::Budget])fromDefaultand a list of field assignments. - options
- Construct
crate::OptionsfromDefaultand a list of field assignments. - render_
options - Construct
crate::RenderOptionsfrom defaults and a list of field assignments. - ser_
options - Construct
crate::SerializerOptionsfromDefaultand a list of field assignments.
Structs§
- ArcAnchor
- A wrapper around
Arc<T>that opt-ins a field for anchor emission (e.g. serialization by reference). - ArcRecursion
- The possibly recursive reference to the parent anchor that must be
ArcRecursive, thread safe It is more complex to use thanRcRecursive(you need to lock it before accessing the value) SeeArcRecursivefor code example. - ArcRecursive
- The parent (origin) anchor definition that may have recursive references to it.
This type provides the value for the references and must be placed where the original value is defined.
Fields that reference this value (possibly recursively) must be wrapped in
ArcRecursion. - ArcWeak
Anchor - A wrapper around [
Weak<T>] (fromstd::sync) that opt-ins for anchor emission. - Cropped
Region - Cropped YAML source window stored inside
Error::WithSnippet. - Default
Message Formatter - Default developer-oriented message formatter.
- Deserializer
- The streaming Serde deserializer.
- FoldStr
- Force a YAML folded block string using the
>style. - Fold
String - Owned-string variant of FoldStr that forces a YAML folded block string using the
>style. - LitStr
- Force a YAML block literal string using the
|style. - LitString
- Owned-string variant of LitStr that forces a YAML block literal string using the
|style. - Location
- Row/column location within the source YAML document (1-indexed, character-based).
- Locations
- Pair of locations for values that may come indirectly from YAML anchors.
- RcAnchor
- A wrapper around
Rc<T>that opt-ins a field for anchor emission (e.g. serialization by reference). - RcRecursion
- The possibly recursive reference to the parent anchor that must be
RcRecursive. SeeRcRecursivefor code example. - RcRecursive
- The parent (origin) anchor definition that may have recursive references to it.
This type provides the value for the references and must be placed where the original value is defined.
Fields that reference this value (possibly recursively) must be wrapped in
RcRecursion. - RcWeak
Anchor - A wrapper around [
Weak<T>] (fromstd::rc) that opt-ins for anchor emission. - Render
Options - Options for deferred error rendering.
- Serializer
Options - Serializer options for YAML emission.
- Span
- A span within the source YAML document.
- Spanned
- A value paired with source locations describing where it came from. Spanned location is specified in character positions and, when possible, in byte offsets as well (byte offsets are available for a string source but not from the reader.
- User
Message Formatter - User-facing message formatter.
Enums§
- Error
- Error type compatible with
serde::de::Error. - Snippet
Mode - Controls whether snippet output is included when available.
- Transform
Reason - The reason why a string value was transformed during parsing and cannot be borrowed.
Traits§
- Message
Formatter - Formats error messages (not including locations/snippets).
Functions§
- from_
multiple - Deserialize multiple YAML documents from a single string into a vector of
T. Completely empty documents are ignored and not included into returned vector. - from_
multiple_ valid - Deserialize multiple YAML documents from a YAML string and validate each with
garde. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
multiple_ validate - Deserialize multiple YAML documents from a YAML string and validate each with
validator. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
multiple_ with_ options - Deserialize multiple YAML documents into a vector with configurable
Options. - from_
multiple_ with_ options_ valid - Deserialize multiple YAML documents with configurable
Optionsand validate each withgarde. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
multiple_ with_ options_ validate - Deserialize multiple YAML documents with configurable
Optionsand validate each withvalidator. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
reader - Deserialize a single YAML document from any
std::io::Read. - from_
reader_ valid - Deserialize a single YAML document from a reader and validate it with
garde. As there is no access to the full text of the document, the error message will not contain a snippet. - from_
reader_ validate - Deserialize a single YAML document from a reader and validate it with
validator. As there is no access to the full text of the document, the error message will not contain a snippet. - from_
reader_ with_ options - Deserialize a single YAML document from any
std::io::Readwith configurableOptions. - from_
reader_ with_ options_ valid - Deserialize a single YAML document from a reader with options and validate it with
garde. As there is no access to the full text of the document, the error message will not contain a snippet. - from_
reader_ with_ options_ validate - Deserialize a single YAML document from a reader with options and validate it with
validator. As there is no access to the full text of the document, the error message will not contain a snippet. - from_
slice - Deserialize a single YAML document from a UTF-8 byte slice.
- from_
slice_ multiple - Deserialize multiple YAML documents from a UTF-8 byte slice into a vector of
T. - from_
slice_ multiple_ with_ options - Deserialize multiple YAML documents from bytes with configurable
Options. Completely empty documents are ignored and not included into returned vector. - from_
slice_ multiple_ with_ options_ valid - Deserialize multiple YAML documents from bytes with options and validate each with
garde. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
slice_ multiple_ with_ options_ validate - Deserialize multiple YAML documents from bytes with options and validate each with
validator. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
slice_ valid - Deserialize a single YAML document from bytes and validate it with
garde. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
slice_ validate - Deserialize a single YAML document from bytes and validate it with
validator. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
slice_ with_ options - Deserialize a single YAML document from a UTF-8 byte slice with configurable
Options. - from_
slice_ with_ options_ valid - Deserialize a single YAML document from bytes and validate it with
garde. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
slice_ with_ options_ validate - Deserialize a single YAML document from bytes and validate it with
validator. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
str - Deserialize any
T: serde::de::Deserialize<'de>directly from a YAML string. - from_
str_ valid - Deserialize a single YAML document from a YAML string and validate it with
garde. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
str_ validate - Deserialize a single YAML document from a YAML string and validate it with
validator. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
str_ with_ options - Deserialize a single YAML document with configurable
Options. - from_
str_ with_ options_ context_ valid - Deserialize a single YAML document with configurable
Optionsand validate it withgardein context [<T as garde::Validate>::Context]. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
str_ with_ options_ valid - Deserialize a single YAML document with configurable
Optionsand validate it withgarde. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - from_
str_ with_ options_ validate - Deserialize a single YAML document with configurable
Optionsand validate it withvalidator. The error message will contain a snippet with exact location information, and if the invalid value comes from anchor, serde-saphyr will also tell where it is defined. - read
- Create an iterator over YAML documents from any
std::io::Readusing default options. - read_
valid - Create an iterator over validated YAML documents from a reader. As there is no access to the full text of the document, the error message will not contain a snippet.
- read_
validate - Create an iterator over validated YAML documents from a reader. As there is no access to the full text of the document, the error message will not contain a snippet.
- read_
with_ options - Create an iterator over YAML documents from any
std::io::Read, with configurable options. - read_
with_ options_ valid - Create an iterator over validated YAML documents from a reader with configurable options. As there is no access to the full text of the document, the error message will not contain a snippet.
- read_
with_ options_ validate - Create an iterator over validated YAML documents from a reader with configurable options. As there is no access to the full text of the document, the error message will not contain a snippet.
- to_
fmt_ writer - Serialize a value as YAML into any [
fmt::Write] target. - to_
fmt_ writer_ with_ options - Serialize a value as YAML into any [
fmt::Write] target, with options. Options are consumed because anchor generator may be taken from them. - to_
io_ writer - Serialize a value as YAML into any [
io::Write] target. - to_
io_ writer_ with_ options - Serialize a value as YAML into any [
io::Write] target, with options. Options are consumed because anchor generator may be taken from them. - to_
string - Serialize a value to a YAML
String. - to_
string_ multiple - Serialize multiple documents into a YAML string.
- to_
string_ with_ options - Serialize a value to a YAML
String, withSerializerOptions. - to_
writer Deprecated - Deprecated: use
to_fmt_writerorto_io_writerKept for a transition release to avoid instant breakage. - to_
writer_ with_ options Deprecated - Deprecated: use
to_fmt_writer_with_optionsforfmt::Writeorto_io_writer_with_optionsforio::Write. - with_
deserializer_ from_ reader - Create a streaming
crate::Deserializerfor anystd::io::Readand run a closure against it. - with_
deserializer_ from_ reader_ with_ options - Create a streaming
crate::Deserializerfor anystd::io::Readwith configurableOptionsand run a closure against it. - with_
deserializer_ from_ slice - Create a streaming
crate::Deserializerfor a UTF-8 byte slice and run a closure against it. - with_
deserializer_ from_ slice_ with_ options - Create a streaming
crate::Deserializerfor a UTF-8 byte slice with configurableOptionsand run a closure against it. - with_
deserializer_ from_ str - Convenience wrapper around
with_deserializer_from_str_with_optionsusingOptions::default. - with_
deserializer_ from_ str_ with_ options - Create a streaming
crate::Deserializerfor a YAML string and run a closure against it.
Type Aliases§
- Developer
Message Formatter - Alias for the default developer-oriented formatter.