Expand description
Converting a crate::Value
to or from strings.
Modules§
- custom_
formatters - This module provides custom formatters that work alongside
crate::stringify::to_writer_custom
and allow for the output to be formatted in various ways. - custom_
parsers - This module provides custom parsers that work alongside
crate::stringify::from_str_custom
and extend the syntax to support parsing common formats intocrate::Value
’s. Seecrate::stringify::from_str_custom
for a usage example.
Structs§
- From
StrBuilder - A struct which will try to parse a string into a
Value
. This can be configured with custom parsers to extend what we’re able to parse into aValue
. - Parse
Error - An error parsing the provided string into a Value
- ToWriter
Builder - A struct which will try to format a
Value
and write the output to a writer. This can be configured with custom parsers to extend how to write out the value.
Enums§
- Parse
BitSequence Error - Parse
Char Error - Parse
Complex Error - Parse
Error Kind - Details about the error that occurred.
- Parse
Number Error - Parse
String Error
Functions§
- from_
str - Attempt to parse a string into a [
crate::Value<()>
], returning a tuple consisting of a result (either the value or aParseError
containing location and error information) and the remainder of the string that wasn’t parsed. - from_
str_ custom - This is similar to
from_str
, except that it returns aFromStrBuilder
, which allows for some additional configuration in how strings are parsed. - to_
string - Identical to calling
to_string()
on thecrate::Value
, but here just to make it a little more obvious that this is the inverse offrom_str
. - to_
writer - Format a
crate::Value
to a string, writing it to the provided writer. - to_
writer_ custom - Format a
crate::Value
to a string. Several options can be configured in the process, such as the indentation, custom formatters, printing of context, and style (compact or spaced).