pub struct RocksDatabase { /* private fields */ }
Expand description
RocksDB Nostr Database
Implementations§
Source§impl RocksDatabase
impl RocksDatabase
Sourcepub async fn open<P>(path: P) -> Result<Self, DatabaseError>
pub async fn open<P>(path: P) -> Result<Self, DatabaseError>
Open database with unlimited capacity
Sourcepub async fn open_bounded<P>(
path: P,
max_capacity: usize,
) -> Result<Self, DatabaseError>
pub async fn open_bounded<P>( path: P, max_capacity: usize, ) -> Result<Self, DatabaseError>
Open database with limited capacity
Trait Implementations§
Source§impl Clone for RocksDatabase
impl Clone for RocksDatabase
Source§fn clone(&self) -> RocksDatabase
fn clone(&self) -> RocksDatabase
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RocksDatabase
impl Debug for RocksDatabase
Source§impl NostrDatabase for RocksDatabase
impl NostrDatabase for RocksDatabase
Source§type Err = DatabaseError
type Err = DatabaseError
Error
Source§fn backend(&self) -> Backend
fn backend(&self) -> Backend
Name of the backend database used (ex. rocksdb, lmdb, sqlite, indexeddb, …)
Source§fn save_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn bulk_import<'life0, 'async_trait>(
&'life0 self,
events: BTreeSet<Event>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bulk_import<'life0, 'async_trait>(
&'life0 self,
events: BTreeSet<Event>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Bulk import events into database Read more
Source§fn has_event_already_been_saved<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 EventId,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_event_already_been_saved<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 EventId,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if
Event
has already been savedSource§fn has_event_already_been_seen<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 EventId,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_event_already_been_seen<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 EventId,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if
EventId
has already been seenSource§fn has_event_id_been_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 EventId,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_event_id_been_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 EventId,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if
EventId
has been deletedSource§fn has_coordinate_been_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
coordinate: &'life1 Coordinate,
timestamp: Timestamp,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_coordinate_been_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
coordinate: &'life1 Coordinate,
timestamp: Timestamp,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if event with
Coordinate
has been deleted before Timestamp
Source§fn event_id_seen<'life0, 'async_trait>(
&'life0 self,
event_id: EventId,
relay_url: Url,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn event_id_seen<'life0, 'async_trait>(
&'life0 self,
event_id: EventId,
relay_url: Url,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn event_seen_on_relays<'life0, 'async_trait>(
&'life0 self,
event_id: EventId,
) -> Pin<Box<dyn Future<Output = Result<Option<HashSet<Url>>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn event_seen_on_relays<'life0, 'async_trait>(
&'life0 self,
event_id: EventId,
) -> Pin<Box<dyn Future<Output = Result<Option<HashSet<Url>>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get list of relays that have seen the
EventId
Source§fn event_by_id<'life0, 'async_trait>(
&'life0 self,
event_id: EventId,
) -> Pin<Box<dyn Future<Output = Result<Event, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn event_by_id<'life0, 'async_trait>(
&'life0 self,
event_id: EventId,
) -> Pin<Box<dyn Future<Output = Result<Event, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn count<'life0, 'async_trait>(
&'life0 self,
filters: Vec<Filter>,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count<'life0, 'async_trait>(
&'life0 self,
filters: Vec<Filter>,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn query<'life0, 'async_trait>(
&'life0 self,
filters: Vec<Filter>,
order: Order,
) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query<'life0, 'async_trait>(
&'life0 self,
filters: Vec<Filter>,
order: Order,
) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query store with filters
Source§fn negentropy_items<'life0, 'async_trait>(
&'life0 self,
filter: Filter,
) -> Pin<Box<dyn Future<Output = Result<Vec<(EventId, Timestamp)>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn negentropy_items<'life0, 'async_trait>(
&'life0 self,
filter: Filter,
) -> Pin<Box<dyn Future<Output = Result<Vec<(EventId, Timestamp)>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get
negentropy
itemsAuto Trait Implementations§
impl Freeze for RocksDatabase
impl !RefUnwindSafe for RocksDatabase
impl Send for RocksDatabase
impl Sync for RocksDatabase
impl Unpin for RocksDatabase
impl !UnwindSafe for RocksDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoNostrDatabase for Twhere
T: NostrDatabase + 'static,
impl<T> IntoNostrDatabase for Twhere
T: NostrDatabase + 'static,
fn into_nostr_database(self) -> Arc<dyn NostrDatabase<Err = DatabaseError>>
Source§impl<T> NostrDatabaseExt for Twhere
T: NostrDatabase + ?Sized,
impl<T> NostrDatabaseExt for Twhere
T: NostrDatabase + ?Sized,
Source§fn profile<'life0, 'async_trait>(
&'life0 self,
public_key: PublicKey,
) -> Pin<Box<dyn Future<Output = Result<Profile, Self::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn profile<'life0, 'async_trait>(
&'life0 self,
public_key: PublicKey,
) -> Pin<Box<dyn Future<Output = Result<Profile, Self::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Get profile metadata