rxing/qrcode/encoder/block_pair.rs
1/*
2 * Copyright 2008 ZXing authors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17pub struct BlockPair {
18 data_bytes: Vec<u8>,
19 error_correction_bytes: Vec<u8>,
20}
21
22impl BlockPair {
23 pub fn new(data: Vec<u8>, error_correction: Vec<u8>) -> Self {
24 Self {
25 data_bytes: data,
26 error_correction_bytes: error_correction,
27 }
28 }
29
30 pub fn getDataBytes(&self) -> &[u8] {
31 &self.data_bytes
32 }
33
34 pub fn getErrorCorrectionBytes(&self) -> &[u8] {
35 &self.error_correction_bytes
36 }
37}