Struct nostr_database::index::DatabaseIndexes
source · pub struct DatabaseIndexes { /* private fields */ }Expand description
Database Indexes
Implementations§
source§impl DatabaseIndexes
impl DatabaseIndexes
sourcepub async fn bulk_index<'a, E>(&self, events: BTreeSet<E>) -> HashSet<EventId>where
E: Into<EventOrTempEvent<'a>>,
pub async fn bulk_index<'a, E>(&self, events: BTreeSet<E>) -> HashSet<EventId>where
E: Into<EventOrTempEvent<'a>>,
Bulk index
sourcepub async fn bulk_import(&self, events: BTreeSet<Event>) -> BTreeSet<Event>
pub async fn bulk_import(&self, events: BTreeSet<Event>) -> BTreeSet<Event>
Bulk import
Take a set of Event, index them and return only the ones that must be stored into the database
sourcepub async fn index_event(&self, event: &Event) -> EventIndexResult
pub async fn index_event(&self, event: &Event) -> EventIndexResult
sourcepub async fn query<I>(&self, filters: I, order: Order) -> Vec<EventId>where
I: IntoIterator<Item = Filter>,
pub async fn query<I>(&self, filters: I, order: Order) -> Vec<EventId>where
I: IntoIterator<Item = Filter>,
Query
sourcepub async fn count<I>(&self, filters: I) -> usizewhere
I: IntoIterator<Item = Filter>,
pub async fn count<I>(&self, filters: I) -> usizewhere
I: IntoIterator<Item = Filter>,
Count events
sourcepub async fn negentropy_items(
&self,
filter: Filter
) -> Vec<(EventId, Timestamp)>
pub async fn negentropy_items( &self, filter: Filter ) -> Vec<(EventId, Timestamp)>
Get negentropy items
sourcepub async fn has_event_id_been_deleted(&self, event_id: &EventId) -> bool
pub async fn has_event_id_been_deleted(&self, event_id: &EventId) -> bool
Check if an event with EventId has been deleted
sourcepub async fn has_coordinate_been_deleted(
&self,
coordinate: &Coordinate,
timestamp: Timestamp
) -> bool
pub async fn has_coordinate_been_deleted( &self, coordinate: &Coordinate, timestamp: Timestamp ) -> bool
Check if event with Coordinate has been deleted before Timestamp
Trait Implementations§
source§impl Clone for DatabaseIndexes
impl Clone for DatabaseIndexes
source§fn clone(&self) -> DatabaseIndexes
fn clone(&self) -> DatabaseIndexes
Returns a copy 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 DatabaseIndexes
impl Debug for DatabaseIndexes
source§impl Default for DatabaseIndexes
impl Default for DatabaseIndexes
source§fn default() -> DatabaseIndexes
fn default() -> DatabaseIndexes
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DatabaseIndexes
impl !RefUnwindSafe for DatabaseIndexes
impl Send for DatabaseIndexes
impl Sync for DatabaseIndexes
impl Unpin for DatabaseIndexes
impl !UnwindSafe for DatabaseIndexes
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