pub trait Input:
Sized
+ Debug
+ 'static {
type Raw: DeserializeOwned + Serialize;
// Required methods
fn tag() -> &'static str;
fn from_raw(raw: Self::Raw, checker: &mut Checker) -> Result<Self>;
fn serialize(&self) -> Result<Value>;
fn example() -> Self::Raw;
}Expand description
Inputs to Benchmarks.
These begin as raw data transfer objects before final construction via
from_raw.
Required Associated Types§
Sourcetype Raw: DeserializeOwned + Serialize
type Raw: DeserializeOwned + Serialize
The raw form of this input that is deserialized from input files and serialized as
examples. The raw nature of this type reflects that no input
validation has been performed beyond the checks performed by its
Deserialize implementation.
Final object validation is performed via from_raw.
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 from_raw(raw: Self::Raw, checker: &mut Checker) -> Result<Self>
fn from_raw(raw: Self::Raw, checker: &mut Checker) -> Result<Self>
Construct Self from the raw deserialized representation, performing any necessary
validation checks (e.g., resolving file paths via the Checker).
Sourcefn serialize(&self) -> Result<Value>
fn serialize(&self) -> Result<Value>
Serialize self to a serde_json::Value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".