Seed a fresh `InMemory` store with `data` and wrap it in a [`ChunkedStore`] that splits every GET response into `chunk_size`-byte pieces.
(
data: &[u8],
chunk_size: usize,
)
| 47 | /// [`ChunkedStore`] that splits every GET response into `chunk_size`-byte |
| 48 | /// pieces. |
| 49 | pub async fn make_chunked_store( |
| 50 | data: &[u8], |
| 51 | chunk_size: usize, |
| 52 | ) -> (Arc<dyn ObjectStore>, Path) { |
| 53 | let inner = Arc::new(InMemory::new()); |
| 54 | let path = Path::from("test"); |
| 55 | inner |
| 56 | .put(&path, PutPayload::from(Bytes::copy_from_slice(data))) |
| 57 | .await |
| 58 | .unwrap(); |
| 59 | (Arc::new(ChunkedStore::new(inner, chunk_size)), path) |
| 60 | } |
| 61 | } |
searching dependent graphs…