Replace trait SharedData with DataAccessor#487
Merged
Conversation
Also rename fn Driver::on_messages -> handle_messages and tweak
This temporarily disables MatrixView
7ecc8fe to
25f3111
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revise how the
kas-viewtraits work:SharedData,ListData,MatrixDataDataAccessor<Index>whereIndexisusizeforListViewor(usize, usize)forMatrixView; queries are simplified relative toList/MatrixDatawhile supportingasyncresultsDriver: change generic parameters, renamefn on_messages→handle_messagesand change its parameterdatato&Item.FilterBoxListwithFilterBoxListView, a similar but more constrained widget over the newDataAccessortrait.FilterListandUnsafeFilteredListadaptor.Unfinished in this PR: scroll bars require the data
lento calculate their length properly; for this reason primarily we require thatfn lenreturn a fixedIndexvalue. We should allow some flexibility here, maybe likeIterator::size_hintor maybe some other way. For now we just document the limitation.Another limitation is that
fn DataAccessor::itemmust return a reference. It could return anOption<Cow<Self::Item>>instead to allow in-place generation of values, or maybe something likeimpl Option<Borrow<Self::Item>>. Is the extra API complexity worth it? Note also that the API usage expects thatfn itemis fast.Yet another limitation:
FilterBoxListViewaccepts&()input data since itsfilteris passed as input data to the data accessor. Ideally bothfilterand this widget's input data would be passed into the accessor, but our input data model is too limited to allow this (#488).Also:
push_async,push_async_erased,push_spawntosend_*since they takeidas input likefn sendunlikefn push.autoimpltraitScrollableforMapAny