pub trait WritePyRepr {
const SHOULD_FLATTEN: bool = false;
// Required method
fn write_py_repr(&self, s: &mut String) -> Result;
}Available on crate feature
python only.Expand description
Trait for Python-specific __repr__ output on record types.
Provided Associated Constants§
Sourceconst SHOULD_FLATTEN: bool = false
const SHOULD_FLATTEN: bool = false
Whether this type’s fields should be flattened into the parent repr.
Required Methods§
Sourcefn write_py_repr(&self, s: &mut String) -> Result
fn write_py_repr(&self, s: &mut String) -> Result
Writes a Python-style string representation to s.
§Errors
This function returns an error if it fails to expand the buffer to fit the string.
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.