Trait ValidCryptoMaterialStringExt

Source
pub trait ValidCryptoMaterialStringExt: ValidCryptoMaterial {
    // Provided methods
    fn from_encoded_string(
        encoded_str: &str,
    ) -> Result<Self, CryptoMaterialError> { ... }
    fn to_encoded_string(&self) -> Result<String> { ... }
}
Expand description

An extension to to/from Strings for ValidCryptoMaterial.

Relies on hex for string encoding / decoding. No required fields, provides a default implementation.

Provided Methods§

Source

fn from_encoded_string(encoded_str: &str) -> Result<Self, CryptoMaterialError>

When trying to convert from bytes, we simply decode the string into bytes before checking if we can convert.

Source

fn to_encoded_string(&self) -> Result<String>

A function to encode into hex-string after serializing.

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§