add basic serde support

This commit is contained in:
Henry Schimke
2023-01-26 14:01:29 -06:00
parent 081577591f
commit 6355dc1bfd
11 changed files with 49 additions and 6 deletions

View File

@@ -16,13 +16,19 @@
//package com.google.zxing;
#![allow(deprecated)]
use crate::{pdf417::encoder::Dimensions, Dimension};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
/**
* These are a set of hints that you may pass to Writers to specify their behavior.
*
* @author dswitkin@google.com (Daniel Switkin)
*/
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum EncodeHintType {
/**
@@ -176,6 +182,7 @@ pub enum EncodeHintType {
CODE128_COMPACT,
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum EncodeHintValue {
/**
* Specifies what degree of error correction to use, for example in QR Codes.