Conversation
The idea to make it easier and more convenient to pass a reference to a Slint global instance into a Rust closure / lambda. Fixes #9389
tronical
left a comment
There was a problem hiding this comment.
Looks good overall. I'm mostly concerned about the documentation, as you can see in the comments ;)
api/rs/slint/docs.rs
Outdated
| /// The `StrongHandle` trait is implemented for each global. | ||
| /// It marks this component as holding a strong reference to the Slint element tree | ||
| /// and allows using this component with a Weak reference. | ||
| impl StrongHandle for SampleGlobal<'static> { |
There was a problem hiding this comment.
I'm curious, why is it important to show that this trait is implemented? Users should never call a function on the trait, right?
There was a problem hiding this comment.
There was a problem hiding this comment.
Maybe I can phrase this differently: If we document this trait, it needs to be documented in a way that conveys to the users what they can do with it, how it relates to the rest of the API.
It is important because that is what enables it to be stored in a Weak
Why is this important to me as a user of the API? What does "enabling" me for me as a user?
(I'm asking because whatever the answer is, it would most likely belong into the docs :-)
and it shows up as the first part of the Weak documentation.
I think it's not uncommon to have internal traits be visible in bounds, etc. but keep the hidden.
1bc64c0 to
ec0965f
Compare

No description provided.