[−][src]Enum ruma::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().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
A version 1 room.
A version 2 room.
A version 3 room.
A version 4 room.
A version 5 room.
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]ⓘ
[src]
Creates a byte slice from this RoomVersionId
.
Trait Implementations
impl AsRef<str> for RoomVersionId
[src]
impl Clone for RoomVersionId
[src]
pub fn clone(&self) -> RoomVersionId
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for RoomVersionId
[src]
impl<'de> Deserialize<'de> for RoomVersionId
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<RoomVersionId, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<RoomVersionId, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for RoomVersionId
[src]
impl Eq for RoomVersionId
[src]
impl From<RoomVersionId> for String
[src]
pub fn from(id: RoomVersionId) -> String
[src]
impl FromStr for RoomVersionId
[src]
type Err = Error
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<RoomVersionId, Error>
[src]
impl Hash for RoomVersionId
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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 RoomVersionId
s or
types containing RoomVersionId
s as BTreeMap
keys.
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'_> PartialEq<&'_ str> for RoomVersionId
[src]
pub fn eq(&self, other: &&str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<RoomVersionId> for RoomVersionId
[src]
pub fn eq(&self, other: &RoomVersionId) -> bool
[src]
pub fn ne(&self, other: &RoomVersionId) -> bool
[src]
impl PartialEq<String> for RoomVersionId
[src]
pub fn eq(&self, other: &String) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[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 RoomVersionId
s or
types containing RoomVersionId
s as BTreeMap
keys.
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for RoomVersionId
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
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.
pub fn try_from(s: &str) -> Result<RoomVersionId, Error>
[src]
impl TryFrom<String> for RoomVersionId
[src]
Auto Trait Implementations
impl RefUnwindSafe for RoomVersionId
[src]
impl Send for RoomVersionId
[src]
impl Sync for RoomVersionId
[src]
impl Unpin for RoomVersionId
[src]
impl UnwindSafe for RoomVersionId
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,