Enum MatrixVersion
#[non_exhaustive]pub enum MatrixVersion {
Show 16 variants
V1_0,
V1_1,
V1_2,
V1_3,
V1_4,
V1_5,
V1_6,
V1_7,
V1_8,
V1_9,
V1_10,
V1_11,
V1_12,
V1_13,
V1_14,
V1_15,
}
Expand description
The Matrix versions Ruma currently understands to exist.
Matrix, since fall 2021, has a quarterly release schedule, using a global vX.Y
versioning
scheme. Usually Y
is bumped for new backwards compatible changes, but X
can be bumped
instead when a large number of Y
changes feel deserving of a major version increase.
Every new version denotes stable support for endpoints in a relatively backwards-compatible manner.
Matrix has a deprecation policy, read more about it here: https://spec.matrix.org/latest/#deprecation-policy.
Ruma keeps track of when endpoints are added, deprecated, and removed. It’ll automatically
select the right endpoint stability variation to use depending on which Matrix versions you
pass to try_into_http_request
, see its
respective documentation for more information.
The PartialOrd
and Ord
implementations of this type sort the variants by release date. A
newer release is greater than an older release.
MatrixVersion::is_superset_of()
is used to keep track of compatibility between versions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V1_0
Matrix 1.0 was a release prior to the global versioning system and does not correspond to a version of the Matrix specification.
It matches the following per-API versions:
- Client-Server API: r0.5.0 to r0.6.1
- Identity Service API: r0.2.0 to r0.3.0
The other APIs are not supported because they do not have a GET /versions
endpoint.
V1_1
Version 1.1 of the Matrix specification, released in Q4 2021.
V1_2
Version 1.2 of the Matrix specification, released in Q1 2022.
V1_3
Version 1.3 of the Matrix specification, released in Q2 2022.
V1_4
Version 1.4 of the Matrix specification, released in Q3 2022.
V1_5
Version 1.5 of the Matrix specification, released in Q4 2022.
V1_6
Version 1.6 of the Matrix specification, released in Q1 2023.
V1_7
Version 1.7 of the Matrix specification, released in Q2 2023.
V1_8
Version 1.8 of the Matrix specification, released in Q3 2023.
V1_9
Version 1.9 of the Matrix specification, released in Q4 2023.
V1_10
Version 1.10 of the Matrix specification, released in Q1 2024.
V1_11
Version 1.11 of the Matrix specification, released in Q2 2024.
V1_12
Version 1.12 of the Matrix specification, released in Q3 2024.
V1_13
Version 1.13 of the Matrix specification, released in Q4 2024.
V1_14
Version 1.14 of the Matrix specification, released in Q1 2025.
V1_15
Version 1.15 of the Matrix specification, released in Q2 2025.
Implementations§
§impl MatrixVersion
impl MatrixVersion
pub fn is_superset_of(self, other: MatrixVersion) -> bool
pub fn is_superset_of(self, other: MatrixVersion) -> bool
Checks whether a version is compatible with another.
Currently, all versions of Matrix are considered backwards compatible with all the previous
versions, so this is equivalent to self >= other
. This behaviour may change in the future,
if a new release is considered to be breaking compatibility with the previous ones.
⚠ Matrix has a deprecation policy, and Matrix versioning is not as straightforward as this function makes it out to be. This function only exists to prune breaking changes between versions, and versions too new for
self
.
pub const fn as_str(self) -> Option<&'static str>
pub const fn as_str(self) -> Option<&'static str>
Get a string representation of this Matrix version.
This is the string that can be found in the response to one of the GET /versions
endpoints. Parsing this string will give the same variant.
Returns None
for MatrixVersion::V1_0
because it can match several per-API versions.
pub fn default_room_version(&self) -> RoomVersionId
pub fn default_room_version(&self) -> RoomVersionId
Get the default RoomVersionId
for this MatrixVersion
.
Trait Implementations§
§impl Clone for MatrixVersion
impl Clone for MatrixVersion
§fn clone(&self) -> MatrixVersion
fn clone(&self) -> MatrixVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for MatrixVersion
impl Debug for MatrixVersion
§impl From<MatrixVersion> for StablePathSelector
impl From<MatrixVersion> for StablePathSelector
§fn from(value: MatrixVersion) -> StablePathSelector
fn from(value: MatrixVersion) -> StablePathSelector
§impl FromStr for MatrixVersion
impl FromStr for MatrixVersion
§type Err = UnknownVersionError
type Err = UnknownVersionError
§fn from_str(s: &str) -> Result<MatrixVersion, <MatrixVersion as FromStr>::Err>
fn from_str(s: &str) -> Result<MatrixVersion, <MatrixVersion as FromStr>::Err>
s
to return a value of this type. Read more§impl Hash for MatrixVersion
impl Hash for MatrixVersion
§impl Ord for MatrixVersion
impl Ord for MatrixVersion
§impl PartialEq for MatrixVersion
impl PartialEq for MatrixVersion
§impl PartialOrd for MatrixVersion
impl PartialOrd for MatrixVersion
§impl TryFrom<&str> for MatrixVersion
impl TryFrom<&str> for MatrixVersion
§type Error = UnknownVersionError
type Error = UnknownVersionError
§fn try_from(
value: &str,
) -> Result<MatrixVersion, <MatrixVersion as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<MatrixVersion, <MatrixVersion as TryFrom<&str>>::Error>
impl Copy for MatrixVersion
impl Eq for MatrixVersion
impl StructuralPartialEq for MatrixVersion
Auto Trait Implementations§
impl Freeze for MatrixVersion
impl RefUnwindSafe for MatrixVersion
impl Send for MatrixVersion
impl Sync for MatrixVersion
impl Unpin for MatrixVersion
impl UnwindSafe for MatrixVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more