(target: &PortalTarget)
| 254 | } |
| 255 | |
| 256 | pub fn describe(target: &PortalTarget) -> Vec<u8> { |
| 257 | let mut writer = BufferWriter::default(); |
| 258 | if let Some(name) = &target.name { |
| 259 | let mut text = String::with_capacity(1 + name.len()); |
| 260 | text.push(target.target_type); |
| 261 | text.push_str(name); |
| 262 | writer.add_cstring(&text); |
| 263 | } else { |
| 264 | let mut value = String::with_capacity(2); |
| 265 | value.push(target.target_type); |
| 266 | writer.add_cstring(&value); |
| 267 | } |
| 268 | writer.flush(Some(CODE_DESCRIBE)) |
| 269 | } |
| 270 | |
| 271 | pub fn close(target: &PortalTarget) -> Vec<u8> { |
| 272 | let mut text = String::with_capacity(target.name.as_ref().map_or(1, |s| 1 + s.len())); |
nothing calls this directly
no test coverage detected