mithril_common::crypto_helper

Trait SerDeShelleyFileFormat

Source
pub trait SerDeShelleyFileFormat: Serialize + DeserializeOwned {
    const TYPE: &'static str;
    const DESCRIPTION: &'static str;

    // Provided methods
    fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, CodecParseError> { ... }
    fn to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), CodecParseError> { ... }
}
Expand description

Trait that allows any structure that implements Serialize and DeserializeOwned to be serialized and deserialized following the Shelly json format.

Required Associated Constants§

Source

const TYPE: &'static str

The type of Cardano key

Source

const DESCRIPTION: &'static str

The description of the Cardano key

Provided Methods§

Source

fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, CodecParseError>

Deserialize a type T: Serialize + DeserializeOwned from file following Cardano Shelley file format.

Source

fn to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), CodecParseError>

Serialize a type T: Serialize + DeserializeOwned to file following Cardano Shelley file format.

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.

Implementors§

Source§

impl SerDeShelleyFileFormat for OpCert

Source§

const TYPE: &'static str = "NodeOperationalCertificate"

Source§

const DESCRIPTION: &'static str = ""

Source§

impl SerDeShelleyFileFormat for Sum6KesBytes

Source§

const TYPE: &'static str = "KesSigningKey_ed25519_kes_2^6"

Source§

const DESCRIPTION: &'static str = "KES Signing Key"