mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-14 11:05:32 -04:00
c418f0e6ba8dd984e29e3db0f09230031e2dce12
TimelineEventTypeFilter (#3025)
Adds a `TimelineEventTypeFilter` enum that either returns only events whose event_type is included in a set of allowed event types, or all events but those whose event types are in a list of excluded event types. Also adds `TimelineEventTypeFilter` so the clients can use it to define those lists of event types, which are then converted to ruma `TimelineEventType` and used for filtering. --- * matrix-sdk-ui: add `TimelineEventTypeFilter` to filter timeline events by either including only those of some event types or all but the ones that match those event types. * ffi: add bindings to `TimelineEventTypeFilter` and `FilterTimelineEventType` so we can provide these event types from the FFI clients * Fix format * Fix tests * Fix format again (using nightly toolchain) * Remove `all_filter_...` functions as there is no right way to support it at the moment and they're just helpers * Improve tests * Make `TimelineEventFilterFn` public so it can be used in several layers. * Make `TimelineEventTypeFilter` a struct in the FFI layer * Add fns for creating a timeline with cache and event type filters * Remove dead code * Fix some review comments * ffi: create new timeline initialization APIs, modify existing ones. ui: make `Room::timeline()` return `None` if no timeline exists instead of lazily creating one. More details: - Added `init_timeline_with_builder` to `matrix_sdk_ui::room_list_service::Room` so a timeline can be initialized at will given a `TimelineBuilder`. - Create `is_timeline_initialized()` fns in both the ui and ffi layers to check the status of the timeline. - Make `matrix_sdk_ui::room_list_service::Room::timeline()` only return a timeline if it's already been initialized. - Create FFI functions to expose these UI ones. * Fix tests * Fix some review comments * Update bindings/matrix-sdk-ffi/src/room_list.rs Signed-off-by: Benjamin Bouvier <public@benj.me> --------- Signed-off-by: Benjamin Bouvier <public@benj.me> Co-authored-by: Benjamin Bouvier <public@benj.me>
matrix-rust-sdk
matrix-rust-sdk is an implementation of a Matrix client-server library in Rust.
Project structure
The rust-sdk consists of multiple crates that can be picked at your convenience:
- matrix-sdk - High level client library, with batteries included, you're most likely interested in this.
- matrix-sdk-base - No (network) IO client state machine that can be used to embed a Matrix client in your project or build a full fledged network enabled client lib on top of it.
- matrix-sdk-crypto - No (network) IO encryption state machine that can be used to add Matrix E2EE support to your client or client library.
Minimum Supported Rust Version (MSRV)
These crates are built with the Rust language version 2021 and require a minimum compiler version of 1.70.
Status
The library is in an alpha state, things that are implemented generally work but the API will change in breaking ways.
If you are interested in using the matrix-sdk now is the time to try it out and provide feedback.
Bindings
Some crates of the matrix-rust-sdk can be embedded inside other
environments, like Swift, Kotlin, JavaScript, Node.js etc. Please,
explore the bindings/ directory to learn more.
License
Description
Languages
Rust
99.7%
HTML
0.2%