Short mechanisms by which this binary can write.
(&self)
| 134 | |
| 135 | /// Short mechanisms by which this binary can write. |
| 136 | pub fn write_mechanisms(&self) -> Vec<String> { |
| 137 | let mut mechanisms = Vec::new(); |
| 138 | for p in &self.protocols { |
| 139 | if p.can_write() { |
| 140 | for a in &p.actions { |
| 141 | if matches!(a.action_type, ActionType::Write | ActionType::Destructive) { |
| 142 | mechanisms.push(format!("{}: {}", p.name, a.name)); |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | if self.can_construct_http { |
| 148 | mechanisms.push("arbitrary HTTP request construction".to_owned()); |
| 149 | } |
| 150 | mechanisms |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | /// Registry of binary capability descriptors. |