@@ -3,7 +3,7 @@ use ruma::{
33 api:: { metadata, request, response, Metadata } ,
44 events:: room:: { guest_access:: GuestAccess , history_visibility:: HistoryVisibility } ,
55 room:: RoomType ,
6- serde:: StringEnum ,
6+ serde:: { OrdAsRefStr , PartialEqAsRefStr , PartialOrdAsRefStr , StringEnum } ,
77 space:: SpaceRoomJoinRule ,
88 OwnedRoomAliasId , OwnedRoomId , OwnedUserId , UInt ,
99} ;
@@ -82,8 +82,9 @@ impl Response {
8282}
8383
8484/// Enum to define the sorting method of rooms.
85- #[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , StringEnum ) ]
85+ #[ derive( Clone , PartialEqAsRefStr , Eq , PartialOrdAsRefStr , OrdAsRefStr , StringEnum ) ]
8686#[ ruma_enum( rename_all = "snake_case" ) ]
87+ #[ non_exhaustive]
8788pub enum RoomSortOrder {
8889 /// Sort by name alphabetical
8990 Name ,
@@ -129,7 +130,8 @@ pub enum RoomSortOrder {
129130}
130131
131132/// Enum to define the sort order direction.
132- #[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , StringEnum ) ]
133+ #[ derive( Clone , PartialEqAsRefStr , Eq , PartialOrdAsRefStr , OrdAsRefStr , StringEnum ) ]
134+ #[ non_exhaustive]
133135pub enum SortDirection {
134136 /// Sort direction backward.
135137 #[ ruma_enum( rename = "b" ) ]
0 commit comments