You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How are messages handled internally? Why do they require Send and Clone?
My concrete problem is that I have some images, stored as gdk_pixbuf::Pixbuf in the model. When clicking on a button, a new image is selected then loaded. So I thought I'd put the new Pixbuf into some AddImage message. But I cannot do this because Message requires Send. Also since Message is Clone I'm starting to doubt if putting big data into it is a good idea at all.
So, how should I go about this? How can I still communicated with and update my model?
The text was updated successfully, but these errors were encountered:
It's neither nor. The problem with glib types is they are internally Rc<RefCell> wrapped. They all have inner mutability and can be cloned and passed around freely. From a Rust perspective, this means that you have absolutely no control over the data in the inner and a Mutex sadly won't change that.
How are messages handled internally? Why do they require
Send
andClone
?My concrete problem is that I have some images, stored as
gdk_pixbuf::Pixbuf
in the model. When clicking on a button, a new image is selected then loaded. So I thought I'd put the newPixbuf
into someAddImage
message. But I cannot do this because Message requiresSend
. Also since Message isClone
I'm starting to doubt if putting big data into it is a good idea at all.So, how should I go about this? How can I still communicated with and update my model?
The text was updated successfully, but these errors were encountered: