Skip to content

Conversation

@TheBlueMatt
Copy link
Contributor

I think Box<dyn> is maybe the simplest to understand for new Rust users. We could also use Arc<dyn> or simply &dyn .

Addresses the issue noted at https://github.com/lightningdevkit/lightningdevkit.org/discussions/55#discussioncomment-1044139

I think `Box<dyn>` is maybe the simplest to understand for new Rust users. We could also use `Arc<dyn>` or simply `&dyn `.
@netlify
Copy link

netlify bot commented Jul 24, 2021

❌ Deploy Preview for ldk-docs-preview failed.

🔨 Explore the source changes: 15c251f

🔍 Inspect the deploy log: https://app.netlify.com/sites/ldk-docs-preview/deploys/60fc5db2d46c3a00073483c0

Copy link

@jochasinga jochasinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Option<Box<dyn Filter>> isn't allowed because it doesn't implement Deref.

https://github.com/lightningdevkit/lightningdevkit.org/discussions/55#discussioncomment-1059653

@TheBlueMatt
Copy link
Contributor Author

The constructor takes an Option, the struct is parameterized by the thing inside the option (which must be Deref), so this should work. See https://docs.rs/lightning/0.0.99/lightning/chain/chainmonitor/struct.ChainMonitor.html#method.new

@jochasinga
Copy link

I think Option<Box<dyn Filter>> isn't allowed because it doesn't implement Deref.

#55 (reply in thread)

I think Option<Box<dyn Filter>> isn't allowed because it doesn't implement Deref.

#55 (reply in thread)

UPDATE: My confusion over ChainMonitor::new(...) accepting Option<Box<dyn Filter>> and Box<dyn Filter>. This is all good.

@valentinewallace valentinewallace merged commit f57f453 into main Jul 28, 2021
@ConorOkus ConorOkus deleted the TheBlueMatt-patch-2 branch May 3, 2022 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants