AsciiArmor

Trait AsciiArmor 

Source
pub trait AsciiArmor: Sized {
    type Err: Debug + From<ArmorParseError>;

    const PLATE_TITLE: &'static str;

    // Required methods
    fn to_ascii_armored_data(&self) -> Vec<u8> ;
    fn with_headers_data(
        headers: Vec<ArmorHeader>,
        data: Vec<u8>,
    ) -> Result<Self, Self::Err>;

    // Provided methods
    fn to_ascii_armored_string(&self) -> String { ... }
    fn display_ascii_armored(&self) -> DisplayAsciiArmored<'_, Self> { ... }
    fn ascii_armored_headers(&self) -> Vec<ArmorHeader> { ... }
    fn ascii_armored_digest(&self) -> Option<Bytes32> { ... }
    fn from_ascii_armored_str(s: &str) -> Result<Self, Self::Err> { ... }
}

Required Associated Constants§

Source

const PLATE_TITLE: &'static str

Required Associated Types§

Required Methods§

Source

fn to_ascii_armored_data(&self) -> Vec<u8>

Source

fn with_headers_data( headers: Vec<ArmorHeader>, data: Vec<u8>, ) -> Result<Self, Self::Err>

Provided Methods§

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.

Implementations on Foreign Types§

Source§

impl AsciiArmor for Vec<u8>

Source§

const PLATE_TITLE: &'static str = "DATA"

Source§

type Err = ArmorParseError

Source§

fn to_ascii_armored_data(&self) -> Vec<u8>

Source§

fn with_headers_data( headers: Vec<ArmorHeader>, data: Vec<u8>, ) -> Result<Self, Self::Err>

Implementors§

Source§

impl<T> AsciiArmor for T
where T: StrictArmor,

Source§

const PLATE_TITLE: &'static str = <T as StrictArmor>::PLATE_TITLE

Source§

type Err = StrictArmorError