Skip to content

Commit 510f578

Browse files
committed
database: impl Any for NostrEventsDatabase
This allows downcasting `Arc<dyn NostrSigner` to concrete database types. Pull-Request: #845 Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 729eb91 commit 510f578

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
### Changed
3131

3232
* nostr: impl `Any` for `NostrSigner` ([Yuki Kishimoto] at https://github.com/rust-nostr/nostr/pull/845)
33+
* database: impl `Any` for `NostrEventsDatabase` ([Yuki Kishimoto] at https://github.com/rust-nostr/nostr/pull/845)
3334

3435
### Added
3536

crates/nostr-database/src/events/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
// Copyright (c) 2023-2025 Rust Nostr Developers
33
// Distributed under the MIT software license
44

5+
use std::any::Any;
56
use std::collections::{BTreeSet, HashMap, HashSet};
6-
use std::fmt;
7+
use std::fmt::Debug;
78
use std::sync::Arc;
89

910
use nostr::prelude::*;
@@ -94,7 +95,7 @@ where
9495
/// Nostr Events Database
9596
///
9697
/// Store for the nostr events.
97-
pub trait NostrEventsDatabase: fmt::Debug + Send + Sync {
98+
pub trait NostrEventsDatabase: Any + Debug + Send + Sync {
9899
/// Save [`Event`] into store
99100
///
100101
/// **This method assumes that [`Event`] was already verified**

0 commit comments

Comments
 (0)