pub trait SampleConfig {
const SAMPLE_OUTPUT_TYPE: OutputType;
// Required methods
fn generate_sample_yaml(&self) -> String;
fn generate_sample_json(&self) -> String;
}Expand description
Generate sample configs for Rust data constructs automatically using an example instance.
Required Associated Constants§
Sourceconst SAMPLE_OUTPUT_TYPE: OutputType
const SAMPLE_OUTPUT_TYPE: OutputType
Whether this data construct produces a value (e.g. String) or fields (e.g. a struct).
Required Methods§
Sourcefn generate_sample_yaml(&self) -> String
fn generate_sample_yaml(&self) -> String
Generate a string containing the sample config in Yaml format.
Sourcefn generate_sample_json(&self) -> String
fn generate_sample_json(&self) -> String
Generate a string containing the sample config in JSON format.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".