keyfork/crates/qrcode/keyfork-zbar/src/symbol.rs

32 lines
538 B
Rust
Raw Normal View History

2024-01-13 07:52:43 +00:00
use super::sys;
pub use sys::zbar_symbol_type_e as SymbolType;
// TODO: config, modifiers
#[derive(Debug)]
pub struct Symbol {
_type: SymbolType,
data: Vec<u8>,
}
impl Symbol {
pub(crate) fn new(_type: SymbolType, data: &[u8]) -> Self {
Self {
_type,
data: data.to_vec(),
}
}
pub fn _type(&self) -> SymbolType {
self._type
}
pub fn data(&self) -> &[u8] {
self.data.as_slice()
}
pub fn into_data(self) -> Vec<u8> {
self.data
}
}