pub struct Space {
pub room_id: String,
pub children: Vec<String>,
pub parents: Vec<String>,
pub suggested: Vec<String>,
}Expand description
Represents a Matrix Space, which is a special type of room used to group rooms.
Fields§
§room_id: StringThe room ID of this space.
children: Vec<String>Child room IDs that belong to this space.
parents: Vec<String>Parent space room IDs for this space.
suggested: Vec<String>Suggested child rooms to show to new members.
Implementations§
Source§impl Space
impl Space
pub fn new(room_id: impl Into<String>) -> Self
Sourcepub fn add_child(&mut self, room_id: impl Into<String>, suggested: bool)
pub fn add_child(&mut self, room_id: impl Into<String>, suggested: bool)
Adds a child room. If suggested is true, it will also appear in the suggested list.
Sourcepub fn remove_child(&mut self, room_id: &str)
pub fn remove_child(&mut self, room_id: &str)
Removes a child room from the space (including from suggested list).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Space
impl<'de> Deserialize<'de> for Space
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Space
impl StructuralPartialEq for Space
Auto Trait Implementations§
impl Freeze for Space
impl RefUnwindSafe for Space
impl Send for Space
impl Sync for Space
impl Unpin for Space
impl UnsafeUnpin for Space
impl UnwindSafe for Space
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.