uem_reader/
commands.rs

1//! Crate commands object type
2
3pub mod reader;
4pub mod cards;
5
6use crate::reader::*;
7use crate::commands::{reader::*, cards::*};
8
9/// Structure for grouping commands in general
10pub struct UemCommands<'a> {
11    reader: &'a UemReader,
12}
13
14/// Accessing general commands group
15pub trait UemCommandsTrait {
16    fn commands(&mut self) -> UemCommands;
17}
18
19impl<'a> UemCommandsReaderTrait for UemCommands<'a> {  
20    fn reader(&mut self) -> UemCommandsReader {
21        UemCommandsReader::new(self.as_reader())
22    }
23}
24
25impl<'a> UemCommandsCardsTrait for UemCommands<'a> {  
26    fn cards(&mut self) -> UemCommandsCards {
27        UemCommandsCards::new(self.as_reader())
28    }
29}
30
31impl<'a> UemCommands<'a> {
32    pub(crate) fn new(rd: &'a UemReader) -> Self {
33        UemCommands {reader: rd}
34    }
35    
36    pub(crate) fn as_reader(&self) -> &'a UemReader {
37        self.reader
38    }
39}