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§
- An enum to represent whether a room is about “people” (strictly 2 users) or “group” (1 or more than 2 users).
Traits§
- A trait “alias” that represents a filter.
Functions§
- Create a new filter that will run multiple filters. It returns
false
if at least one of the filter returnsfalse
. - Create a new filter that will run multiple filters. It returns
true
if at least one of the filter returnstrue
. - 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. - Create a new filter that will filter out rooms that are not marked as favourite (see
matrix_sdk_base::Room::is_favourite
). - Create a new filter that will fuzzy match a pattern on room names.
- Create a new filter that will filter out rooms that are not invites (see
matrix_sdk_base::RoomState::Invited
). - Create a new filter that will filters out rooms that are not joined (see
matrix_sdk_base::RoomState::Joined
). - Create a new filter that will filters out left rooms.
- Create a new filter that will reject all entries.
- Create a new filter that will “normalized” match a pattern on room names.
- Create a new filter that will negate the inner filter. It returns
false
if the inner filter returnstrue
, otherwise it returnstrue
. - Create a new filter that will filters out rooms that have no unread notifications (different from unread messages), or is not marked as unread.
Type Aliases§
- Type alias for a boxed filter function.