matrix-rust-sdk
matrix-rust-sdk copied to clipboard
Most of the data inside `RoomInfo` is not available from its API
BaseRoom::subscribe_info
allows to keep track of changes in the RoomInfo
. However most of the data in RoomInfo
is not accessible from its methods but from the methods of BaseRoom
. That makes receiving the RoomInfo
from the subscriber not that interesting.
I would like to find a way to have all the RoomInfo
-related methods on RoomInfo
, while having a simple way to access them on Room
. The issue I see is that always using BaseRoom::clone_info
means we need to clone the whole structure when we might want to use a single field.
Here is what we can't do:
- Redefining every method on
Room
manually is annoying, and needs to be kept up to date. - We can't implement
Deref
because that allows the user to keep a reference to theRoomInfo
, but it is mutable.
Maybe cloning the RoomInfo
each time is actually a non-issue, given that it is already what happens with BaseRoom::subscribe_info
.