pub trait JSON<'a>: Serialize + Deserialize<'a> {
// Provided methods
fn parse<T: AsRef<str>>(&mut self, s: &'a T) -> Result<(), Error> { ... }
fn to_string(&self) -> String { ... }
fn stringify(&self, indent: usize) -> String { ... }
fn read<F: AsRef<Path>>(
&mut self,
file: F,
content: &'a mut String,
) -> Result<(), String> { ... }
fn write<F: AsRef<Path>>(&self, file: F) -> Result<()> { ... }
}Provided Methods§
Sourcefn stringify(&self, indent: usize) -> String
fn stringify(&self, indent: usize) -> String
Stringify a native-json object
indent
- 0 : output concise JSON string
- N : pretty output with N spaces indentation
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.