nostrdb-rs

nostrdb in rust!
git clone git://jb55.com/nostrdb-rs
Log | Files | Refs | Submodules | README | LICENSE

commit e4eb36050df3050def6854381bb065634652da81
parent befb8f2c130e33c806cb477ee38316ea7bc26b06
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 30 Dec 2023 20:59:41 -0800

note: expose id field

Diffstat:
Msrc/note.rs | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/note.rs b/src/note.rs @@ -99,6 +99,13 @@ impl<'a> Note<'a> { } } + pub fn id(&self) -> &'a [u8; 32] { + unsafe { + let ptr = bindings::ndb_note_id(self.as_ptr()); + &*(ptr as *const [u8; 32]) + } + } + pub fn kind(&self) -> u32 { unsafe { bindings::ndb_note_kind(self.as_ptr()) } }