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

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

Meta