Remove a record by type.
(&mut self, type_: u64)
| 145 | |
| 146 | /// Remove a record by type. |
| 147 | pub fn remove(&mut self, type_: u64) -> Option<Vec<u8>> { |
| 148 | if let Some(pos) = self.0.iter().position(|rec| rec.type_ == type_) { |
| 149 | Some(self.0.remove(pos).value) |
| 150 | } else { |
| 151 | None |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | /// Check if a type exists. |
| 156 | pub fn contains(&self, type_: u64) -> bool { |
no outgoing calls