Trait fuzzcheck::Serializer[][src]

pub trait Serializer {
    type Value;
    fn extension(&self) -> &str;
fn from_data(&self, data: &[u8]) -> Option<Self::Value>;
fn to_data(&self, value: &Self::Value) -> Vec<u8>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
; }
Expand description

A Serializer is used to encode and decode values into bytes.

One possible implementation would be to use serde to implement both required functions. But we also want to be able to fuzz-test types that are not serializable with serde, which is why this trait exists.

Associated Types

The type of the valeu to be serialized

Required methods

The extension of the file containing the serialized value

Deserialize the bytes into the value.

This method can fail by returning None

Serialize the value into bytes

This method should never fail.

Implementors