0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-04 21:08:57 +01:00

ircd::db: Add valid(rocksdb::Status) to suite.

This commit is contained in:
Jason Volk 2020-06-06 19:53:18 -07:00
parent 61d0165883
commit 8b7fe333ec
2 changed files with 21 additions and 0 deletions

View file

@ -8078,6 +8078,26 @@ ircd::db::valid(const rocksdb::Iterator &it)
}
}
bool
ircd::db::valid(const rocksdb::Status &s)
{
switch(s.code())
{
using rocksdb::Status;
case Status::kOk:
return true;
case Status::kNotFound:
case Status::kIncomplete:
return false;
default:
throw_on_error{s};
__builtin_unreachable();
}
}
//
// column_names
//

View file

@ -102,6 +102,7 @@ namespace ircd::db
std::vector<std::string> column_names(const std::string &path, const std::string &options);
// Validation functors
bool valid(const rocksdb::Status &);
bool valid(const rocksdb::Iterator &);
bool operator!(const rocksdb::Iterator &);
using valid_proffer = std::function<bool (const rocksdb::Iterator &)>;