Struct matrix_sdk::matrix_auth::MatrixSession
source · pub struct MatrixSession {
pub meta: SessionMeta,
pub tokens: MatrixSessionTokens,
}
Expand description
A user session using the native Matrix authentication API.
§Examples
use matrix_sdk::{
matrix_auth::{MatrixSession, MatrixSessionTokens},
SessionMeta,
};
use ruma::{device_id, user_id};
let session = MatrixSession {
meta: SessionMeta {
user_id: user_id!("@example:localhost").to_owned(),
device_id: device_id!("MYDEVICEID").to_owned(),
},
tokens: MatrixSessionTokens {
access_token: "My-Token".to_owned(),
refresh_token: None,
},
};
assert_eq!(session.meta.device_id.as_str(), "MYDEVICEID");
Fields§
§meta: SessionMeta
The Matrix user session info.
tokens: MatrixSessionTokens
The tokens used for authentication.
Trait Implementations§
source§impl Clone for MatrixSession
impl Clone for MatrixSession
source§fn clone(&self) -> MatrixSession
fn clone(&self) -> MatrixSession
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MatrixSession
Available on non-tarpaulin_include
only.
impl Debug for MatrixSession
Available on non-
tarpaulin_include
only.source§impl<'de> Deserialize<'de> for MatrixSession
impl<'de> Deserialize<'de> for MatrixSession
source§fn 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
source§impl From<&Response> for MatrixSession
impl From<&Response> for MatrixSession
source§impl From<MatrixSession> for AuthSession
impl From<MatrixSession> for AuthSession
source§fn from(session: MatrixSession) -> Self
fn from(session: MatrixSession) -> Self
Converts to this type from the input type.
source§impl Hash for MatrixSession
impl Hash for MatrixSession
source§impl PartialEq for MatrixSession
impl PartialEq for MatrixSession
source§fn eq(&self, other: &MatrixSession) -> bool
fn eq(&self, other: &MatrixSession) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for MatrixSession
impl Serialize for MatrixSession
impl Eq for MatrixSession
impl StructuralPartialEq for MatrixSession
Auto Trait Implementations§
impl Freeze for MatrixSession
impl RefUnwindSafe for MatrixSession
impl Send for MatrixSession
impl Sync for MatrixSession
impl Unpin for MatrixSession
impl UnwindSafe for MatrixSession
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
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
Compare self to
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
Compare self to
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>
Consume a handle, getting back the initial
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>
Converts
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>
Converts
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