// Copyright (C) 2022 Daniel Mueller <deso@posteo.net>
// SPDX-License-Identifier: GPL-3.0-or-later
usestd::error::Error;/// A trait abstracting over a specific serialization & deserialization
/// backend.
pubtraitBackend<T> {/// The error type emitted as part of serialization and
/// deserialization.
typeError: Error +Send+Sync+'static;/// Serialize an object to a byte buffer.
fnserialize(object:&T)->Result<Vec<u8>, Self::Error>;/// Deserialize an object from a byte buffer.
fndeserialize(data:&[u8])->Result<T, Self::Error>;}