(&mut self)
| 376 | R: AsyncRepo + Send + 'static, |
| 377 | { |
| 378 | fn drop(&mut self) { |
| 379 | if let Some(current_segment) = self.current_segment.take() { |
| 380 | trace!("closing current segment on writer drop"); |
| 381 | tokio::spawn( |
| 382 | current_segment |
| 383 | .close() |
| 384 | .inspect_err(|e| warn!("error closing segment on drop: {e}")), |
| 385 | ); |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | /// What to do when [`StreamWriter::create`] detects trailing (invalid) data |