Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note builder api #11

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "nostrdb"
authors = ["William Casarin <[email protected]>"]
description = "An unfairly fast embedded nostr database backed by lmdb"
readme = "README.md"
version = "0.3.3"
version = "0.3.4"
edition = "2021"
build = "build.rs"
license = "GPL-3.0-or-later"
Expand Down
2 changes: 1 addition & 1 deletion nostrdb
Submodule nostrdb updated 4 files
+1 −1 .envrc
+4 −39 ndb.c
+2 −1 src/protected_queue.h
+32 −0 src/thread.h
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
mkShell {
nativeBuildInputs = [ rustPlatform.bindgenHook cargo clippy rustc rustfmt libiconv pkg-config valgrind ];
nativeBuildInputs = [ rustPlatform.bindgenHook cargo clippy rustc rustfmt libiconv pkg-config valgrind gdb ];

LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use filter::Filter;
pub use ndb::Ndb;
pub use ndb_profile::{NdbProfile, NdbProfileRecord};
pub use ndb_str::{NdbStr, NdbStrVariant};
pub use note::{Note, NoteKey};
pub use note::{Note, NoteBuildOptions, NoteBuilder, NoteKey};
pub use profile::{ProfileKey, ProfileRecord};
pub use query::QueryResult;
pub use result::Result;
Expand Down
6 changes: 3 additions & 3 deletions src/ndb_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{bindings, Note};

pub struct NdbStr<'a> {
ndb_str: bindings::ndb_str,
note: Note<'a>,
note: &'a Note<'a>,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -39,10 +39,10 @@ impl bindings::ndb_str {

impl<'a> NdbStr<'a> {
pub fn note(&self) -> &Note<'a> {
&self.note
self.note
}

pub(crate) fn new(ndb_str: bindings::ndb_str, note: Note<'a>) -> Self {
pub(crate) fn new(ndb_str: bindings::ndb_str, note: &'a Note<'a>) -> Self {
NdbStr { ndb_str, note }
}

Expand Down
Loading
Loading