(&self, buf: &mut Vec<u8>)
| 85 | } |
| 86 | |
| 87 | pub fn append_to(&self, buf: &mut Vec<u8>) { |
| 88 | if let Some(bytes) = self.as_contiguous() { |
| 89 | buf.extend_from_slice(&bytes); |
| 90 | } else { |
| 91 | let bytes = &*self.obj_bytes(); |
| 92 | self.desc.for_each_segment(true, |range| { |
| 93 | buf.extend_from_slice(&bytes[range.start as usize..range.end as usize]) |
| 94 | }); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | pub fn contiguous_or_collect<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R { |
| 99 | let borrowed; |
no test coverage detected