Enum ruma_common::RoomVersionId
source · [−]#[non_exhaustive]
pub enum RoomVersionId {
V1,
V2,
V3,
V4,
V5,
V6,
V7,
V8,
V9,
// 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 RoomVersionId
s PartialEq
implementations or through .as_str()
.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
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.
Implementations
Trait Implementations
sourceimpl AsRef<str> for RoomVersionId
impl AsRef<str> for RoomVersionId
sourceimpl Clone for RoomVersionId
impl Clone for RoomVersionId
sourcefn clone(&self) -> RoomVersionId
fn clone(&self) -> RoomVersionId
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RoomVersionId
impl Debug for RoomVersionId
sourceimpl<'de> Deserialize<'de> for RoomVersionId
impl<'de> Deserialize<'de> for RoomVersionId
sourcefn 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
sourceimpl Display for RoomVersionId
impl Display for RoomVersionId
sourceimpl From<RoomVersionId> for String
impl From<RoomVersionId> for String
sourcefn from(id: RoomVersionId) -> Self
fn from(id: RoomVersionId) -> Self
Converts to this type from the input type.
sourceimpl FromStr for RoomVersionId
impl FromStr for RoomVersionId
sourceimpl Hash for RoomVersionId
impl Hash for RoomVersionId
sourceimpl Ord for RoomVersionId
impl Ord for RoomVersionId
sourcefn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
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 RoomVersionId
s or
types containing RoomVersionId
s as BTreeMap
keys.
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
sourceimpl PartialEq<&str> for RoomVersionId
impl PartialEq<&str> for RoomVersionId
sourceimpl PartialEq<RoomVersionId> for RoomVersionId
impl PartialEq<RoomVersionId> for RoomVersionId
sourcefn eq(&self, other: &RoomVersionId) -> bool
fn eq(&self, other: &RoomVersionId) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RoomVersionId) -> bool
fn ne(&self, other: &RoomVersionId) -> bool
This method tests for !=
.
sourceimpl PartialEq<RoomVersionId> for &str
impl PartialEq<RoomVersionId> for &str
sourceimpl PartialEq<RoomVersionId> for String
impl PartialEq<RoomVersionId> for String
sourceimpl PartialEq<String> for RoomVersionId
impl PartialEq<String> for RoomVersionId
sourceimpl PartialOrd<RoomVersionId> for RoomVersionId
impl PartialOrd<RoomVersionId> for RoomVersionId
sourcefn partial_cmp(&self, other: &RoomVersionId) -> Option<Ordering>
fn partial_cmp(&self, other: &RoomVersionId) -> Option<Ordering>
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 RoomVersionId
s or
types containing RoomVersionId
s as BTreeMap
keys.
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for RoomVersionId
impl Serialize for RoomVersionId
sourceimpl TryFrom<&str> for RoomVersionId
impl TryFrom<&str> for RoomVersionId
sourceimpl TryFrom<String> for RoomVersionId
impl TryFrom<String> for RoomVersionId
impl Eq for RoomVersionId
impl StructuralEq for RoomVersionId
impl StructuralPartialEq for RoomVersionId
Auto Trait Implementations
impl RefUnwindSafe for RoomVersionId
impl Send for RoomVersionId
impl Sync for RoomVersionId
impl Unpin for RoomVersionId
impl UnwindSafe for RoomVersionId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more