Expand description
A collection of room filters.
The room list can provide an access to the rooms per list, like with
super::RoomList::entries_with_dynamic_adapters
. The provided collection
of rooms can be filtered with these filters. A classical usage would be the
following:
use matrix_sdk_ui::room_list_service::{
filters, RoomListDynamicEntriesController,
};
fn configure_room_list(
entries_controller: &RoomListDynamicEntriesController,
) {
// _All_ non-left rooms
// _and_ that fall in the “People” category,
// _and_ that are marked as favourite,
// _and_ that are _not_ unread.
entries_controller.set_filter(Box::new(
// All
filters::new_filter_all(vec![
// Non-left
Box::new(filters::new_filter_non_left()),
// People
Box::new(filters::new_filter_category(
filters::RoomCategory::People,
)),
// Favourite
Box::new(filters::new_filter_favourite()),
// Not Unread
Box::new(filters::new_filter_not(Box::new(
filters::new_filter_unread(),
))),
]),
));
}
Enums§
- Room
Category - An enum to represent whether a room is about “people” (strictly 2 users) or “group” (1 or more than 2 users).
Traits§
- Filter
- A trait “alias” that represents a filter.
Functions§
- new_
filter_ all - Create a new filter that will run multiple filters. It returns
false
if at least one of the filter returnsfalse
. - new_
filter_ any - Create a new filter that will run multiple filters. It returns
true
if at least one of the filter returnstrue
. - new_
filter_ category - Create a new filter that will accept all rooms that fit in the
expected_category
. The category is defined byRoomCategory
, see this type to learn more. - new_
filter_ deduplicate_ versions - Create a new filter that will filter out room versions that are outdated. Only the “active” versions are kept.
- new_
filter_ favourite - Create a new filter that will filter out rooms that are not marked as
favourite (see
matrix_sdk_base::Room::is_favourite
). - new_
filter_ fuzzy_ match_ room_ name - Create a new filter that will fuzzy match a pattern on room names.
- new_
filter_ invite - Create a new filter that will filter out rooms that are not invites (see
matrix_sdk_base::RoomState::Invited
). - new_
filter_ joined - Create a new filter that will filter out rooms that are not joined (see
matrix_sdk_base::RoomState::Joined
). - new_
filter_ non_ left - Create a new filter that will filter out left rooms.
- new_
filter_ none - Create a new filter that will reject all entries.
- new_
filter_ normalized_ match_ room_ name - Create a new filter that will “normalized” match a pattern on room names.
- new_
filter_ not - Create a new filter that will negate the inner filter. It returns
false
if the inner filter returnstrue
, otherwise it returnstrue
. - new_
filter_ unread - Create a new filter that will filter out rooms that have no unread notifications (different from unread messages), or is not marked as unread.
Type Aliases§
- Boxed
Filter Fn Non- target_family="wasm"
- Type alias for a boxed filter function.