pub trait SerRon {
// Required method
fn ser_ron(&self, indent_level: usize, state: &mut SerRonState);
// Provided method
fn serialize_ron(&self) -> String { ... }
}
Expand description
A trait for objects that can be serialized to the RON file format.
Required Methods§
sourcefn ser_ron(&self, indent_level: usize, state: &mut SerRonState)
fn ser_ron(&self, indent_level: usize, state: &mut SerRonState)
Serialize Self to a RON string.
let mut s = SerRonState { out: String::new() };
42u32.ser_ron(0, &mut s);
assert_eq!(s.out, "42");
Provided Methods§
sourcefn serialize_ron(&self) -> String
fn serialize_ron(&self) -> String
Serialize Self to a RON string.
This is a convenient wrapper around ser_ron
.