Skip to content

Compiler Error: Trait Bound Not Satisfied When Adding AsyncComponent as Child to gtk::Stack #518

Answered by AaronErhardt
run-stop asked this question in Q&A
Discussion options

You must be logged in to vote

Your approach sounds good and should actually work. The problems you have are likely very easy to fix.

However, the sender must be of type Arc<Mutex<AsyncComponentSender<>>>. This is problematic because AsyncComponentSender is not thread-safe, meaning it cannot be shared between threads.

You should be able to clone the sender, or at least a specific instance like .input_sender(). I don't understand what you mean with no thread-safety because all senders in Relm4 should be Send + Sync and also implement Clone.

However, commands should be a better concept for you and basically exactly what you are looking for. I recommend you to read through the threads and async chapter of the book: http…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@run-stop
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@run-stop
Comment options

@AaronErhardt
Comment options

@run-stop
Comment options

@AaronErhardt
Comment options

Answer selected by run-stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants