Enum matrix_sdk::ruma::api::MatrixVersion
source · #[non_exhaustive]pub enum MatrixVersion {
Show 13 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,
}
api
only.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.
Every new minor 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.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V1_0
Version 1.0 of the Matrix specification.
Retroactively defined as https://spec.matrix.org/latest/#legacy-versioning.
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.
Implementations§
source§impl MatrixVersion
impl MatrixVersion
sourcepub 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.
A is compatible with B as long as B is equal or less, so long as A and B have the same major versions.
For example, v1.2 is compatible with v1.1, as it is likely only some additions of endpoints on top of v1.1, but v1.1 would not be compatible with v1.2, as v1.1 cannot represent all of v1.2, in a manner similar to set theory.
Warning: Matrix has a deprecation policy, and Matrix versioning is not as
straight-forward as this function makes it out to be. This function only exists
to prune major version differences, and versions too new for self
.
This (considering if major versions are the same) is equivalent to a self >= other
check.
sourcepub const fn into_parts(self) -> (u8, u8)
pub const fn into_parts(self) -> (u8, u8)
Decompose the Matrix version into its major and minor number.
sourcepub const fn from_parts(
major: u8,
minor: u8,
) -> Result<MatrixVersion, UnknownVersionError>
pub const fn from_parts( major: u8, minor: u8, ) -> Result<MatrixVersion, UnknownVersionError>
Try to turn a pair of (major, minor) version components back into a MatrixVersion
.
sourcepub fn default_room_version(&self) -> RoomVersionId
pub fn default_room_version(&self) -> RoomVersionId
Get the default RoomVersionId
for this MatrixVersion
.
Trait Implementations§
source§impl Clone for MatrixVersion
impl Clone for MatrixVersion
source§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 moresource§impl Debug for MatrixVersion
impl Debug for MatrixVersion
source§impl Display for MatrixVersion
impl Display for MatrixVersion
source§impl FromStr for MatrixVersion
impl FromStr for MatrixVersion
§type Err = UnknownVersionError
type Err = UnknownVersionError
source§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 moresource§impl Hash for MatrixVersion
impl Hash for MatrixVersion
source§impl PartialEq for MatrixVersion
impl PartialEq for MatrixVersion
source§fn eq(&self, other: &MatrixVersion) -> bool
fn eq(&self, other: &MatrixVersion) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<&str> for MatrixVersion
impl TryFrom<&str> for MatrixVersion
§type Error = UnknownVersionError
type Error = UnknownVersionError
source§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt 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§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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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