pub trait Input {
// Required methods
fn tag() -> &'static str;
fn try_deserialize(serialized: &Value, checker: &mut Checker) -> Result<Any>;
fn example() -> Result<Value>;
}Required Methods§
Sourcefn tag() -> &'static str
fn tag() -> &'static str
Return the discriminant associated with this type.
This is used to map inputs types to their respective parsers.
Well formed implementations should always return the same result.
Sourcefn try_deserialize(serialized: &Value, checker: &mut Checker) -> Result<Any>
fn try_deserialize(serialized: &Value, checker: &mut Checker) -> Result<Any>
Attempt to deserialize an opaque object from the raw serialized representation.
Deserialized values can be constructed and returned via Checker::any,
Any::new or Any::raw.
If using the Any constructors directly, implementations should associate
Self::tag with the returned Any. If Checker::any is used - this will
happen automatically.
Implementations are strongly encouraged to implement
CheckDeserialization and use this API to ensure
shared resources (like input files or output files) are correctly resolved and
properly shared among all jobs in a benchmark run.
Sourcefn example() -> Result<Value>
fn example() -> Result<Value>
Print an example JSON representation of objects this input is expected to parse.
Well-formed implementations should ensure that passing the returned
serde_json::Value back to Self::try_deserialize correctly deserializes,
though it need not necessarily pass
CheckDeserialization.
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.