libhardcopy 1.0.1

Generalized library for hardcopy/softcopy command line utilities.
Documentation
use crate::{HardCopy, HardCopyInput, SoftCopy, SoftCopyInput};

// Possible plugin implementations
#[cfg(feature = "out-bip39")]
pub mod bip39;
#[cfg(feature = "out-diceware")]
pub mod diceware;
pub mod pgpfone;
#[cfg(feature = "out-qrcode")]
pub mod qrcode;
pub mod skeyotp;

/// Library Plugin, can have support for hard-copy generation,
/// soft-copy generation, and/or soft-copy validation.
pub trait LibPlugin {
    fn name(&self) -> String;
    fn description(&self) -> String;
    fn instructions(&self) -> String;
}

pub enum GenerationError {}

pub trait HardCopyGenerator {
    fn generate_hard_copy(&self, softinput: &SoftCopyInput) -> Result<HardCopy, GenerationError>;
}

pub trait SoftCopyGenerator {
    fn generate_soft_copy(&self, input: &mut HardCopyInput) -> Result<SoftCopy, GenerationError>;
}

pub enum ValidationError {}

pub trait SoftCopyValidator {
    fn validate_soft_copy(&self, softcopy: &SoftCopyInput) -> Result<(), ValidationError>;

    // TODO: is there any way to coerce a hard-copy-input into a SoftCopy?
    fn validate_hard_copy_input(&self, input: &HardCopyInput) -> Result<(), ValidationError>;
}