escpos_rust/command/code_table.rs
1extern crate serde;
2
3use serde::{Serialize, Deserialize};
4
5/// Possible character sets
6#[derive(Serialize, Deserialize, Clone, Debug)]
7pub enum CodeTable {
8 USA,
9 Latin2
10}
11
12impl CodeTable {
13 /// Returns the byte representation of the esc/pos command
14 pub fn as_bytes(&self) -> Vec<u8> {
15 match self {
16 CodeTable::USA => vec![0x00],
17 CodeTable::Latin2 => vec![0x02]
18 }
19 }
20}