(&mut self, bytes: &Bytes)
| 142 | } |
| 143 | |
| 144 | pub(crate) fn push_bytes(&mut self, bytes: &Bytes) -> Result<(), Report<BufferError>> { |
| 145 | if self.0.remaining_mut() < bytes.len() { |
| 146 | return Err(Report::new(BufferError::NotEnoughCapacity)); |
| 147 | } |
| 148 | |
| 149 | let cursor = Cursor::new(bytes); |
| 150 | |
| 151 | self.0.put(cursor); |
| 152 | |
| 153 | Ok(()) |
| 154 | } |
| 155 | |
| 156 | pub(crate) fn push_slice(&mut self, slice: &[u8]) -> Result<(), Report<BufferError>> { |
| 157 | if self.0.remaining_mut() < slice.len() { |