mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-06-22 15:18:33 -04:00
For some room lists, the number of entries can be gigantic. For example, some accounts have 800, 2500, or even 4000 rooms! It's not necessary for the client/app to display all the 4000 rooms. First, it can create some performance issues, second, nobody will scroll 4000 rooms to search for a particular room :-). Such users are more likely to use a search bar or something equivalent. The idea is that `RoomListService` will continue to sync all the data, but only a _limited_ version of it will be shared to the client/app. This patch takes `RoomList::entries_with_dynamic_filter`, and improves it to include this (dynamic) limit. This patch renames `RoomList::entries_with_dynamic_filter` to `::entries_with_dynamic_adapters`. It now returns a `RoomListDynamicEntriesController`, which is a renaming of `DynamicRoomListFilter`. Basically, the “dynamic filter” becomes a “dynamic controller” because `RoomList::entries_with_dynamic_adapters` manages more than a filter. It now uses `eyeball_im_util::vector::DynamicLimit` to dynamically limit the size of entries. And that's the major idea behind this patch. `RoomListDynamicEntriesController::set` is renamed `::set_filter`, and 2 new methods are introduced: `add_one_page` and `reset_to_one_page`. A _page_ is like a chunk of room entries we want to view or add. When doing `next_page`, the limit increases to `old_limit + page_size`. The `reset_pages` method resets the `limit` to `page_size` only.
Matrix Rust SDK bindings
In this directory, one can find bindings to the Rust SDK that are maintained by the owners of the Matrix Rust SDK project.
appleormatrix-rust-components-swift, Swift bindings of thematrix-sdkcrate viamatrix-sdk-ffi,matrix-sdk-crypto-ffi, UniFFI (Kotlin, Swift, Python, Ruby) bindings of thematrix-sdk-cryptocrate,matrix-sdk-ffi, UniFFI bindings of thematrix-sdkcrate.
There are also external bindings in other repositories:
matrix-sdk-crypto-js, JavaScript bindings of thematrix-sdk-cryptocrate,matrix-sdk-crypto-nodejs, Node.js bindings of thematrix-sdk-cryptocrate
Contributing
To contribute read this guide.