Skip to content

Commit 2513d28

Browse files
committed
nostr: impl Any for NostrSigner
This allows downcasting `Arc<dyn NostrSigner>` to `Keys` or other concrete signer types. Pull-Request: #845 Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 3461c04 commit 2513d28

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
@@ -40,6 +40,7 @@
4040

4141
- nostr: rework `NostrParser` ([Yuki Kishimoto] at https://github.com/rust-nostr/nostr/pull/899)
4242
- pool: refine notification sending depending on event database saving status ([Yuki Kishimoto] at https://github.com/rust-nostr/nostr/pull/911)
43+
- nostr: impl `Any` for `NostrSigner` ([Yuki Kishimoto] at https://github.com/rust-nostr/nostr/pull/845)
4344

4445
### Added
4546

crates/nostr/src/signer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
use alloc::borrow::Cow;
88
use alloc::string::String;
99
use alloc::sync::Arc;
10-
use core::fmt;
10+
use core::any::Any;
11+
use core::fmt::{self, Debug};
1112

1213
use crate::util::BoxedFuture;
1314
use crate::{Event, PublicKey, UnsignedEvent};
@@ -88,7 +89,7 @@ pub enum SignerBackend<'a> {
8889
}
8990

9091
/// Nostr signer abstraction
91-
pub trait NostrSigner: fmt::Debug + Send + Sync {
92+
pub trait NostrSigner: Any + Debug + Send + Sync {
9293
/// Signer backend
9394
fn backend(&self) -> SignerBackend;
9495

0 commit comments

Comments
 (0)