rxing/oned/rss/expanded/decoders/block_parsed_result.rs
1/*
2 * Copyright (C) 2010 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
17/*
18 * These authors would like to acknowledge the Spanish Ministry of Industry,
19 * Tourism and Trade, for the support in the project TSI020301-2008-2
20 * "PIRAmIDE: Personalizable Interactions with Resources on AmI-enabled
21 * Mobile Dynamic Environments", led by Treelogic
22 * ( http://www.treelogic.com/ ):
23 *
24 * http://www.piramidepse.com/
25 */
26
27use super::DecodedInformation;
28
29/**
30 * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
31 * @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es)
32 */
33pub struct BlockParsedRXingResult {
34 decodedInformation: Option<DecodedInformation>,
35 finished: bool,
36}
37
38impl Default for BlockParsedRXingResult {
39 fn default() -> Self {
40 Self::new()
41 }
42}
43
44impl BlockParsedRXingResult {
45 pub fn new() -> Self {
46 Self::with_information(None, false)
47 }
48
49 pub fn with_information(information: Option<DecodedInformation>, finished: bool) -> Self {
50 Self {
51 decodedInformation: information,
52 finished,
53 }
54 }
55
56 pub fn getDecodedInformation(&self) -> &Option<DecodedInformation> {
57 &self.decodedInformation
58 }
59
60 pub fn isFinished(&self) -> bool {
61 self.finished
62 }
63}