DB.get_slice

Gets an entry from the DB as a Slice.

class DB
get_slice
(
T
)

Return Value

Type: auto

A Slice struct, this holds the returned pointer and size Slice will safely clean up the result

Throws

LeveldbException

Examples

auto opt = new Options;
opt.create_if_missing = true;
auto db = new DB(opt, "/my/db/");
auto uuid = UUID("8AB3060E-2cba-4f23-b74c-b52db3bdfb46");
db.put("My UUID", uuid.data);
auto name = db.get_slice("My UUID");
assert(name.as!UUID == uuid);

Meta