Trait NostrEventsDatabaseExt

Source
pub trait NostrEventsDatabaseExt: NostrEventsDatabase {
    // Provided methods
    fn metadata(
        &self,
        public_key: PublicKey,
    ) -> BoxedFuture<'_, Result<Option<Metadata>, DatabaseError>> { ... }
    fn contacts_public_keys(
        &self,
        public_key: PublicKey,
    ) -> BoxedFuture<'_, Result<HashSet<PublicKey>, DatabaseError>> { ... }
    fn contacts(
        &self,
        public_key: PublicKey,
    ) -> BoxedFuture<'_, Result<BTreeSet<Profile>, DatabaseError>> { ... }
    fn relay_list(
        &self,
        public_key: PublicKey,
    ) -> BoxedFuture<'_, Result<HashMap<RelayUrl, Option<RelayMetadata>>, DatabaseError>> { ... }
    fn relay_lists<'a, I>(
        &'a self,
        public_keys: I,
    ) -> BoxedFuture<'a, Result<HashMap<PublicKey, HashMap<RelayUrl, Option<RelayMetadata>>>, DatabaseError>>
       where I: IntoIterator<Item = PublicKey> + Send + 'a { ... }
}
Expand description

Nostr Event Store Extension

Provided Methods§

Source

fn metadata( &self, public_key: PublicKey, ) -> BoxedFuture<'_, Result<Option<Metadata>, DatabaseError>>

Get public key metadata

Source

fn contacts_public_keys( &self, public_key: PublicKey, ) -> BoxedFuture<'_, Result<HashSet<PublicKey>, DatabaseError>>

Get contact list public keys

Source

fn contacts( &self, public_key: PublicKey, ) -> BoxedFuture<'_, Result<BTreeSet<Profile>, DatabaseError>>

Get contact list with metadata of PublicKey

Source

fn relay_list( &self, public_key: PublicKey, ) -> BoxedFuture<'_, Result<HashMap<RelayUrl, Option<RelayMetadata>>, DatabaseError>>

Source

fn relay_lists<'a, I>( &'a self, public_keys: I, ) -> BoxedFuture<'a, Result<HashMap<PublicKey, HashMap<RelayUrl, Option<RelayMetadata>>>, DatabaseError>>
where I: IntoIterator<Item = PublicKey> + Send + 'a,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§