This differential implements wrapper around generated C++ bindings for blob download process so that caller does not need to instantiate objects from ::rust namespace
Details
Details
- Launch local instance of blob service.
- Place the following code somewhere in CommCoreModule:
std::string holder = "test.holder.v0"; std::string hash = "test.hash.v0"; auto data = { std::string(4000000, 'a'), std::string(4000000, 'b'), std::string(4000000, 'c'), std::string(4000000, 'd'), std::string(4000000, 'e'), std::string(4000000, 'f'), std::string(4000000, 'g'), }; UploadBlobClient client; client.startUploadBlocking(holder, hash); for (auto &chunk : data) { client.uploadChunkBlocking((std::uint8_t *)chunk.c_str(), chunk.length()); } client.completeUploadBlocking(); std::vector<std::vector<std::uint8_t>> buffer; DownloadBlobClient downloadClient(holder); while (true) { auto resp = downloadClient.pullChunkBlocking(); if (std::get<0>(resp)) { break; } buffer.push_back(std::get<1>(resp)); } int sum = 0; for (auto &it : buffer) { sum += it.size(); } Logger::log("Total data size: " + std::to_string(sum));
Check the logs to ensure that size of downloaded data is 28000000
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- marcin/eng-384-native-rust-lib
- Lint
No Lint Coverage - Unit
No Test Coverage