mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
wip: incomplete port checking
This commit is contained in:
@@ -30,7 +30,7 @@ use serde::{Deserialize, Serialize};
|
||||
* @author Sean Owen
|
||||
*/
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct RXingResult {
|
||||
text: String,
|
||||
rawBytes: Vec<u8>,
|
||||
@@ -39,6 +39,7 @@ pub struct RXingResult {
|
||||
format: BarcodeFormat,
|
||||
resultMetadata: HashMap<RXingResultMetadataType, RXingResultMetadataValue>,
|
||||
timestamp: u128,
|
||||
line_count: usize,
|
||||
}
|
||||
impl RXingResult {
|
||||
pub fn new(
|
||||
@@ -83,6 +84,7 @@ impl RXingResult {
|
||||
format,
|
||||
resultMetadata: HashMap::new(),
|
||||
timestamp,
|
||||
line_count: 0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +97,7 @@ impl RXingResult {
|
||||
format: prev.format,
|
||||
resultMetadata: prev.resultMetadata,
|
||||
timestamp: prev.timestamp,
|
||||
line_count: prev.line_count,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,6 +232,18 @@ impl RXingResult {
|
||||
pub fn getTimestamp(&self) -> u128 {
|
||||
self.timestamp
|
||||
}
|
||||
|
||||
pub fn line_count(&self) -> usize {
|
||||
self.line_count
|
||||
}
|
||||
|
||||
pub fn set_line_count(&mut self, lc: usize) {
|
||||
self.line_count = lc
|
||||
}
|
||||
|
||||
pub fn replace_points(&mut self, points: Vec<Point>) {
|
||||
self.resultPoints = points
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RXingResult {
|
||||
|
||||
Reference in New Issue
Block a user