Module sorters

Source
Expand description

A collection of room sorters.

Traits§

Sorter
A trait “alias” that represents a sorter.

Functions§

new_sorter_latest_event
Create a new sorter that will sort two RoomListItem by their latest events’ state: latest events representing a local event (LatestEventValue::LocalIsSending or LatestEventValue::LocalCannotBeSent) come first, and latest event representing a remote event (LatestEventValue::Remote) come last.
new_sorter_lexicographic
Create a new sorter that will run multiple sorters. When the nth sorter returns Ordering::Equal, the next sorter is called. It stops as soon as a sorter return Ordering::Greater or Ordering::Less.
new_sorter_name
Create a new sorter that will sort two RoomListItem by name, i.e. by comparing their display names. A lexicographically ordering is applied, i.e. “a” < “b”.
new_sorter_recency
Create a new sorter that will sort two RoomListItem by recency, i.e. by comparing their RoomInfo::new_latest_event’s recency (timestamp) if any (i.e. if different from LatestEventValue::None), or their RoomInfo::recency_stamp value. The Room with the newest recency stamp comes first, i.e. newest < oldest.

Type Aliases§

BoxedSorterFnNon-target_family="wasm"
Type alias for a boxed sorter function.