Enum ruma::RoomVersionId[][src]

#[non_exhaustive]
pub enum RoomVersionId {
    Version1,
    Version2,
    Version3,
    Version4,
    Version5,
    Version6,
    // 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 (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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

Creates a string slice from this RoomVersionId.

Creates a byte slice from this RoomVersionId.

Trait Implementations

Performs the conversion.

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

Performs the conversion.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

Performs the conversion.

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

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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