Trait tuf::interchange::DataInterchange [] [src]

pub trait DataInterchange: Debug + PartialEq + Clone {
    type RawData: Serialize + DeserializeOwned + Clone + PartialEq;
    fn extension() -> &'static str;
fn canonicalize(raw_data: &Self::RawData) -> Result<Vec<u8>>;
fn deserialize<T>(raw_data: &Self::RawData) -> Result<T>
    where
        T: DeserializeOwned
;
fn serialize<T>(data: &T) -> Result<Self::RawData>
    where
        T: Serialize
;
fn to_writer<W, T: Sized>(writer: W, value: &T) -> Result<()>
    where
        W: Write,
        T: Serialize
;
fn from_reader<R, T>(rdr: R) -> Result<T>
    where
        R: Read,
        T: DeserializeOwned
; }

The format used for data interchange, serialization, and deserialization.

Associated Types

The type of data that is contained in the signed portion of metadata.

Required Methods

The data interchange's extension.

A function that canonicalizes data to allow for deterministic signatures.

Deserialize from RawData.

Serialize into RawData.

Write a struct to a stream.

Note: This MUST write the bytes canonically for hashes to line up correctly in other areas of the library.

Read a struct from a stream.

Implementors