logo
pub enum RoomVersionId {
    V1,
    V2,
    V3,
    V4,
    V5,
    V6,
    V7,
    V8,
    V9,
    V10,
    // some variants omitted
}
Expand description

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

V1

A version 1 room.

V2

A version 2 room.

V3

A version 3 room.

V4

A version 4 room.

V5

A version 5 room.

V6

A version 6 room.

V7

A version 7 room.

V8

A version 8 room.

V9

A version 9 room.

V10

A version 10 room.

Implementations

Creates a string slice from this RoomVersionId.

Creates a byte slice from this RoomVersionId.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more

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.

Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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.

This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more