[][src]Enum ruma::RoomVersionId

pub enum RoomVersionId {
    Version1,
    Version2,
    Version3,
    Version4,
    Version5,
    Version6,
    // some variants omitted
}

A Matrix room version ID.

A RoomVersionId can be or converted or deserialized from a string slice, and can be converted or serialized back into a string as needed.

assert_eq!(RoomVersionId::try_from("1").unwrap().as_ref(), "1");

Any string consisting of at minimum 1, at maximum 32 unicode codepoints is a room version ID. Custom room versions or ones that were introduced into the specification after this code was written are represented by a hidden enum variant. You can still construct them the same, and check for them using one of RoomVersionIds PartialEq implementations or through .as_str().

Variants

Version1

A version 1 room.

Version2

A version 2 room.

Version3

A version 3 room.

Version4

A version 4 room.

Version5

A version 5 room.

Version6

A version 6 room.

Implementations

impl RoomVersionId[src]

pub fn as_str(&self) -> &str[src]

Creates a string slice from this RoomVersionId.

pub fn as_bytes(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Creates a byte slice from this RoomVersionId.

Trait Implementations

impl AsRef<str> for RoomVersionId[src]

impl Clone for RoomVersionId[src]

impl Debug for RoomVersionId[src]

impl<'de> Deserialize<'de> for RoomVersionId[src]

impl Display for RoomVersionId[src]

impl Eq for RoomVersionId[src]

impl From<RoomVersionId> for String[src]

impl FromStr for RoomVersionId[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for RoomVersionId[src]

impl Ord for RoomVersionId[src]

pub fn cmp(&self, other: &RoomVersionId) -> Ordering[src]

Compare the two given room version IDs by comparing their string representations.

Please be aware that room version IDs don't have a defined ordering in the Matrix specification. This implementation only exists to be able to use RoomVersionIds or types containing RoomVersionIds as BTreeMap keys.

impl<'_> PartialEq<&'_ str> for RoomVersionId[src]

impl PartialEq<RoomVersionId> for RoomVersionId[src]

impl PartialEq<String> for RoomVersionId[src]

impl PartialOrd<RoomVersionId> for RoomVersionId[src]

pub fn partial_cmp(&self, other: &RoomVersionId) -> Option<Ordering>[src]

Compare the two given room version IDs by comparing their string representations.

Please be aware that room version IDs don't have a defined ordering in the Matrix specification. This implementation only exists to be able to use RoomVersionIds or types containing RoomVersionIds as BTreeMap keys.

impl Serialize for RoomVersionId[src]

impl StructuralEq for RoomVersionId[src]

impl StructuralPartialEq for RoomVersionId[src]

impl<'_> TryFrom<&'_ str> for RoomVersionId[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<String> for RoomVersionId[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.