(&self, k: K, d: D, bytes: &[u8])
| 544 | } |
| 545 | |
| 546 | pub fn insert_bytes(&self, k: K, d: D, bytes: &[u8]) { |
| 547 | let mut fh = match self.new_tempfile() { |
| 548 | Some(fh) => fh, |
| 549 | None => return, |
| 550 | }; |
| 551 | |
| 552 | if let Err(e) = fh.write(bytes) { |
| 553 | error!(?e, "failed to write bytes to file"); |
| 554 | return; |
| 555 | }; |
| 556 | |
| 557 | if let Err(e) = fh.flush() { |
| 558 | error!(?e, "failed to flush bytes to file"); |
| 559 | return; |
| 560 | } |
| 561 | |
| 562 | self.insert(k, d, fh) |
| 563 | } |
| 564 | |
| 565 | // Add an item? |
| 566 | pub fn insert(&self, k: K, d: D, mut fh: NamedTempFile) { |
nothing calls this directly
no test coverage detected