Enum ruma_common::api::MatrixVersion
source · [−]#[non_exhaustive]
pub enum MatrixVersion {
V1_0,
V1_1,
V1_2,
}
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/v1.2/#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/v1.2/#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.
Implementations
sourceimpl MatrixVersion
impl MatrixVersion
sourcepub fn is_superset_of(self, other: Self) -> bool
pub fn is_superset_of(self, other: Self) -> 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 fn into_parts(self) -> (u8, u8)
pub fn into_parts(self) -> (u8, u8)
Decompose the Matrix version into its major and minor number.
sourcepub fn from_parts(major: u8, minor: u8) -> Result<Self, UnknownVersionError>
pub fn from_parts(major: u8, minor: u8) -> Result<Self, UnknownVersionError>
Try to turn a pair of (major, minor) version components back into a MatrixVersion
.
Trait Implementations
sourceimpl Clone for MatrixVersion
impl Clone for MatrixVersion
sourcefn clone(&self) -> MatrixVersion
fn clone(&self) -> MatrixVersion
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 MatrixVersion
impl Debug for MatrixVersion
sourceimpl Display for MatrixVersion
impl Display for MatrixVersion
sourceimpl FromStr for MatrixVersion
impl FromStr for MatrixVersion
sourceimpl Hash for MatrixVersion
impl Hash for MatrixVersion
sourceimpl PartialEq<MatrixVersion> for MatrixVersion
impl PartialEq<MatrixVersion> for MatrixVersion
sourceimpl TryFrom<&str> for MatrixVersion
impl TryFrom<&str> for MatrixVersion
type Error = UnknownVersionError
type Error = UnknownVersionError
The type returned in the event of a conversion error.
impl Copy for MatrixVersion
impl Eq for MatrixVersion
impl StructuralEq for MatrixVersion
impl StructuralPartialEq for MatrixVersion
Auto Trait Implementations
impl RefUnwindSafe for MatrixVersion
impl Send for MatrixVersion
impl Sync for MatrixVersion
impl Unpin for MatrixVersion
impl UnwindSafe for MatrixVersion
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