32 lines
538 B
Rust
32 lines
538 B
Rust
|
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
|
||
|
}
|
||
|
}
|