[][src]Struct ruma_identifiers::RoomVersionId

pub struct RoomVersionId(_);

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().to_string(), "1");

Methods

impl RoomVersionId[src]

pub fn version_1() -> Self[src]

Creates a version 1 room ID.

pub fn version_2() -> Self[src]

Creates a version 2 room ID.

pub fn version_3() -> Self[src]

Creates a version 3 room ID.

pub fn version_4() -> Self[src]

Creates a version 4 room ID.

pub fn version_5() -> Self[src]

Creates a version 5 room ID.

pub fn custom(id: &str) -> Self[src]

Creates a custom room version ID from the given string slice.

pub fn is_official(&self) -> bool[src]

Whether or not this room version is an official one specified by the Matrix protocol.

pub fn is_custom(&self) -> bool[src]

Whether or not this is a custom room version.

pub fn is_version_1(&self) -> bool[src]

Whether or not this is a version 1 room.

pub fn is_version_2(&self) -> bool[src]

Whether or not this is a version 2 room.

pub fn is_version_3(&self) -> bool[src]

Whether or not this is a version 3 room.

pub fn is_version_4(&self) -> bool[src]

Whether or not this is a version 4 room.

pub fn is_version_5(&self) -> bool[src]

Whether or not this is a version 5 room.

Trait Implementations

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 Hash for RoomVersionId[src]

impl PartialEq<RoomVersionId> for RoomVersionId[src]

impl Serialize for RoomVersionId[src]

impl StructuralEq for RoomVersionId[src]

impl StructuralPartialEq for RoomVersionId[src]

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

type Error = Error

The type returned in the event of a conversion error.

fn try_from(room_version_id: &'a str) -> Result<Self, Error>[src]

Attempts to create a new Matrix room version ID from a string representation.

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: 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 = !

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,