You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-22 08:45:09 +02:00
.github
mdbook-course
mdbook-exerciser
po
src
theme
third_party
cxx
blobstore
include
blobstore.h
src
Android.bp
BUILD
Cargo.toml
build.rs
book
LICENSE-APACHE
LICENSE-MIT
README.md
overview.svg
mdbook
rust-by-example
rust-on-exercism
.gitignore
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
README.md
STYLE.md
TRANSLATIONS.md
aspect-ratio-helper.py
book.toml
dprint.json
rustfmt.toml
Add a number of slides that cover most of CXX's functionality and demonstrate how it can be used. Fixes #823. --------- Co-authored-by: Martin Geisler <mgeisler@google.com>
33 lines
609 B
C++
33 lines
609 B
C++
#pragma once
|
|
#include "rust/cxx.h"
|
|
#include <memory>
|
|
#include <set>
|
|
#include <unordered_map>
|
|
#include <string>
|
|
|
|
namespace org {
|
|
namespace blobstore {
|
|
|
|
struct MultiBuf;
|
|
struct BlobMetadata;
|
|
|
|
class BlobstoreClient {
|
|
public:
|
|
BlobstoreClient();
|
|
uint64_t put(MultiBuf &buf);
|
|
void tag(uint64_t blobid, rust::Str tag);
|
|
BlobMetadata metadata(uint64_t blobid) const;
|
|
|
|
private:
|
|
using Blob = struct {
|
|
std::string data;
|
|
std::set<std::string> tags;
|
|
};
|
|
std::unordered_map<uint64_t, Blob> blobs;
|
|
};
|
|
|
|
std::unique_ptr<BlobstoreClient> new_blobstore_client();
|
|
|
|
} // namespace blobstore
|
|
} // namespace org
|