blob: 78365a98fefdd8574d73afd7753f1af6d7ea9b12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#[derive(Debug)]
pub enum TransactionType {
PACS008,
PACS002,
}
impl std::fmt::Display for TransactionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
TransactionType::PACS002 => "pacs.002.001.12",
TransactionType::PACS008 => "pacs.008.001.12",
}
)
}
}
/// Pacs008 file descriptor
pub const ISO20022_FILE_DESCRIPTOR_SET: &[u8] =
tonic::include_file_descriptor_set!("iso20022_descriptor");
/// pacs.008.001.12
pub mod pacs008 {
tonic::include_proto!("iso20022.pacs008");
}
/// pacs.002.001.12
pub mod pacs002 {
tonic::include_proto!("iso20022.pacs002");
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn display_pacs008() {
let t = TransactionType::PACS008;
assert_eq!(t.to_string(), "pacs.008.001.12");
}
#[test]
fn display_pacs002() {
let t = TransactionType::PACS002;
assert_eq!(t.to_string(), "pacs.002.001.12");
}
}
|