nostrdb 0.9.0

An unfairly fast embedded nostr database backed by lmdb
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{Ndb, SubscriptionStream};

#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct Subscription(u64);

impl Subscription {
    pub fn new(id: u64) -> Self {
        Self(id)
    }
    pub fn id(self) -> u64 {
        self.0
    }

    pub fn stream(&self, ndb: &Ndb) -> SubscriptionStream {
        SubscriptionStream::new(ndb.clone(), *self)
    }
}