Expand description
Format a Value into JASN text.
The main entry points are format() and format_pretty() for common use cases.
For custom formatting options, use format_with_opts() with Options.
use jasn::{Value, format};
let value = Value::String("hello".to_string());
assert_eq!(format(&value), r#""hello""#);
// Custom formatting with advanced options
use jasn::formatter::{Options, format_with_opts};
let opts = Options::pretty().with_indent("\t");
let formatted = format_with_opts(&value, &opts);Structs§
- Options
- Formatting options for JASN output.
Enums§
- Binary
Encoding - Binary data encoding preference.
- Quote
Style - Quote style for strings and map keys.
- Timestamp
Precision - Precision for timestamp fractional seconds.
Functions§
- format
- Formats a JASN
Valueinto a compact string (no unnecessary whitespace). - format_
pretty - Formats a JASN
Valueinto a pretty-printed string with indentation and newlines. - format_
with_ opts - Formats a JASN
Valuewith custom formatting options.