pub trait ToRonwhere
Self: Serialize,{
// Provided methods
fn to_ron(&self) -> Result<String, Error> { ... }
fn to_ron_pretty(
&self,
config: Option<PrettyConfig>,
) -> Result<String, Error> { ... }
}Expand description
Trait with default methods that allow implementors parse them to RON format.
Provided Methods§
Sourcefn to_ron(&self) -> Result<String, Error>
fn to_ron(&self) -> Result<String, Error>
Returns a RON from implementor.
§Errors
Will return Error with kind ErrorKind::SerializingFailed if it fails to serialize this implementor.
Sourcefn to_ron_pretty(&self, config: Option<PrettyConfig>) -> Result<String, Error>
fn to_ron_pretty(&self, config: Option<PrettyConfig>) -> Result<String, Error>
Returns a pretty formatted RON from implementor.
§Arguments
Optional config gives a PrettyConfig to use for formatting,
with one set if None is provided.
§Errors
Will return Error with kind ErrorKind::SerializingFailed if it fails to serialize implementor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".