nostrdb/rust: initial api for Ndb and NdbConfig

This is the start of our rust library for nostrdb. Implement idiomatic
interfaces for Ndb and NdbConfig.

Changelog-Added: Add initial rust library
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-14 11:59:25 -08:00
committed by Daniel D’Aquino
parent e3001cc240
commit 3a7cf4d08d
2 changed files with 2 additions and 2 deletions

View File

@@ -3155,7 +3155,7 @@ static int ndb_run_migrations(struct ndb *ndb)
return 1;
}
int ndb_init(struct ndb **pndb, const char *filename, struct ndb_config *config)
int ndb_init(struct ndb **pndb, const char *filename, const struct ndb_config *config)
{
struct ndb *ndb;
//MDB_dbi ind_id; // TODO: ind_pk, etc

View File

@@ -296,7 +296,7 @@ int ndb_decode_key(const char *secstr, struct ndb_keypair *keypair);
int ndb_note_verify(void *secp_ctx, unsigned char pubkey[32], unsigned char id[32], unsigned char signature[64]);
// NDB
int ndb_init(struct ndb **ndb, const char *dbdir, struct ndb_config *);
int ndb_init(struct ndb **ndb, const char *dbdir, const struct ndb_config *);
int ndb_db_version(struct ndb *ndb);
int ndb_process_event(struct ndb *, const char *json, int len);
int ndb_process_events(struct ndb *, const char *ldjson, size_t len);