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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
use IndexMap;
// pub struct Amf0Object {
// pub key: String,
// pub value: Amf0ValueType,
// }
// impl Amf0Object {
// pub fn clone(self) -> Amf0Object {
// Amf0Object {
// key: self.key.clone(),
// value: self.value.clone(),
// }
// }
// }
// pub struct AmfObjectMap{
// properties: HashMap<String,Amf0Object>,
// }
// impl AmfObjectMap {
// fn Clone(self) -> AmfObjectMap {
// self.properties.clone()
// }
// }
// pub struct UnOrderedMap {
// properties: Vec<Amf0Object>,
// }
// impl UnOrderedMap {
// pub fn new() -> UnOrderedMap {
// UnOrderedMap {
// properties: Vec::new(),
// }
// }
// pub fn insert(self, key: String, val: Amf0ValueType) -> Option<Amf0ValueType> {
// for i in &self.properties {
// if i.key == key {
// let tmpVal = i.value.clone();
// i.value = val;
// return Some(tmpVal);
// }
// }
// let obj = Amf0Object {
// key: key,
// value: val,
// };
// self.properties.push(obj);
// None
// }
// fn get_by_key(self, key: String) -> Option<Amf0ValueType> {
// for i in self.properties {
// if i.key == key {
// return Some(i.value);
// }
// }
// None
// }
// pub fn get(self, idx: usize) -> Amf0Object {
// self.properties[idx]
// }
// pub fn len(self) -> usize {
// self.properties.len()
// }
// pub fn Clone(self) -> UnOrderedMap {
// UnOrderedMap {
// properties: self.properties.clone(),
// }
// }
// }