pub struct StoredSession {
pub homeserver: Url,
pub user_id: OwnedUserId,
pub device_id: OwnedDeviceId,
pub id: String,
pub client_id: Option<ClientId>,
pub passphrase: Zeroizing<String>,
}Expand description
A session, as stored in the secret service.
Fields§
§homeserver: UrlThe URL of the homeserver where the account lives.
user_id: OwnedUserIdThe unique identifier of the user.
device_id: OwnedDeviceIdThe unique identifier of the session on the homeserver.
id: StringThe unique local identifier of the session.
This is the name of the directories where the session data lives.
client_id: Option<ClientId>The unique identifier of the client with the homeserver.
passphrase: Zeroizing<String>The passphrase used to encrypt the local databases.
Implementations§
Source§impl StoredSession
impl StoredSession
Sourcefn from_parts(attributes: Attributes, passphrase: Zeroizing<String>) -> Self
fn from_parts(attributes: Attributes, passphrase: Zeroizing<String>) -> Self
Construct a StoredSession from its attributes and passphrase.
Sourcefn into_parts(self) -> (Attributes, Zeroizing<String>)
fn into_parts(self) -> (Attributes, Zeroizing<String>)
Split this stored session between its attributes and passphrase.
Sourceasync fn try_from_secret_item(item: Item) -> Result<Option<Self>, Box<Error>>
async fn try_from_secret_item(item: Item) -> Result<Option<Self>, Box<Error>>
Try to construct a StoredSession from an item from the secret backend.
Returns Err if a problem occurred with the secret backend, Ok(None)
if the item is not a valid stored session, and Ok(Some(_)) if it is a
valid stored session.
Sourceasync fn apply_migrations(
&self,
from_version: u8,
item: Item,
access_token: Option<String>,
)
async fn apply_migrations( &self, from_version: u8, item: Item, access_token: Option<String>, )
Migrate this session to the current version.
Any error that occurs is logged.
Sourceasync fn delete_unsupported(self, version: u8, access_token: Option<String>)
async fn delete_unsupported(self, version: u8, access_token: Option<String>)
Delete this unsupported session and all its data.
Source§impl StoredSession
impl StoredSession
Sourcepub(crate) async fn new(client: &Client) -> Result<Self, ClientSetupError>
pub(crate) async fn new(client: &Client) -> Result<Self, ClientSetupError>
Construct a StoredSession from the session of the given Matrix client.
Returns an error if we failed to generate a unique session ID for the new session.
Sourcepub(crate) fn data_path(&self) -> PathBuf
pub(crate) fn data_path(&self) -> PathBuf
The path where the persistent data of this session lives.
Sourceasync fn create_data_dir(&self)
async fn create_data_dir(&self)
Create the directory where the persistent data of this session will live.
Sourcepub(crate) fn cache_path(&self) -> PathBuf
pub(crate) fn cache_path(&self) -> PathBuf
The path where the cached data of this session lives.
Sourcefn tokens_path(&self) -> PathBuf
fn tokens_path(&self) -> PathBuf
The path to the files containing the session tokens.
Sourcepub(crate) async fn load_tokens(&self) -> Option<SessionTokens>
pub(crate) async fn load_tokens(&self) -> Option<SessionTokens>
Load the tokens of this session.
Sourcepub(crate) async fn store_tokens(&self, tokens: SessionTokens)
pub(crate) async fn store_tokens(&self, tokens: SessionTokens)
Store the tokens of this session.
Trait Implementations§
Source§impl BoxedType for StoredSession
impl BoxedType for StoredSession
Source§impl Clone for StoredSession
impl Clone for StoredSession
Source§fn clone(&self) -> StoredSession
fn clone(&self) -> StoredSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StoredSession
impl Debug for StoredSession
Source§impl From<StoredSession> for Value
impl From<StoredSession> for Value
Source§fn from(v: StoredSession) -> Self
fn from(v: StoredSession) -> Self
Source§impl FromGlibPtrBorrow<*const StoredSession> for StoredSession
impl FromGlibPtrBorrow<*const StoredSession> for StoredSession
Source§unsafe fn from_glib_borrow(ptr: *const StoredSession) -> Borrowed<Self>
unsafe fn from_glib_borrow(ptr: *const StoredSession) -> Borrowed<Self>
Source§impl FromGlibPtrBorrow<*mut StoredSession> for StoredSession
impl FromGlibPtrBorrow<*mut StoredSession> for StoredSession
Source§unsafe fn from_glib_borrow(ptr: *mut StoredSession) -> Borrowed<Self>
unsafe fn from_glib_borrow(ptr: *mut StoredSession) -> Borrowed<Self>
Source§impl FromGlibPtrFull<*mut StoredSession> for StoredSession
impl FromGlibPtrFull<*mut StoredSession> for StoredSession
Source§unsafe fn from_glib_full(ptr: *mut StoredSession) -> Self
unsafe fn from_glib_full(ptr: *mut StoredSession) -> Self
Source§impl FromGlibPtrNone<*const StoredSession> for StoredSession
impl FromGlibPtrNone<*const StoredSession> for StoredSession
Source§unsafe fn from_glib_none(ptr: *const StoredSession) -> Self
unsafe fn from_glib_none(ptr: *const StoredSession) -> Self
Source§impl FromGlibPtrNone<*mut StoredSession> for StoredSession
impl FromGlibPtrNone<*mut StoredSession> for StoredSession
Source§unsafe fn from_glib_none(ptr: *mut StoredSession) -> Self
unsafe fn from_glib_none(ptr: *mut StoredSession) -> Self
Source§impl<'a> FromValue<'a> for StoredSession
impl<'a> FromValue<'a> for StoredSession
Source§type Checker = GenericValueTypeChecker<StoredSession>
type Checker = GenericValueTypeChecker<StoredSession>
Source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value. Read moreSource§impl<'a> FromValue<'a> for &'a StoredSession
impl<'a> FromValue<'a> for &'a StoredSession
Source§type Checker = GenericValueTypeChecker<&'a StoredSession>
type Checker = GenericValueTypeChecker<&'a StoredSession>
Source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value. Read moreSource§impl GlibPtrDefault for StoredSession
impl GlibPtrDefault for StoredSession
type GlibType = *mut StoredSession
Source§impl HasParamSpec for StoredSession
impl HasParamSpec for StoredSession
type ParamSpec = ParamSpecBoxed
Source§type SetValue = StoredSession
type SetValue = StoredSession
type BuilderFn = fn(&str) -> ParamSpecBoxedBuilder<'_, StoredSession>
fn param_spec_builder() -> Self::BuilderFn
Source§impl IntoGlibPtr<*mut StoredSession> for StoredSession
impl IntoGlibPtr<*mut StoredSession> for StoredSession
Source§fn into_glib_ptr(self) -> *mut StoredSession
fn into_glib_ptr(self) -> *mut StoredSession
Source§impl StaticType for StoredSession
impl StaticType for StoredSession
Source§fn static_type() -> Type
fn static_type() -> Type
Self.Source§impl<'a> ToGlibPtr<'a, *const StoredSession> for StoredSession
impl<'a> ToGlibPtr<'a, *const StoredSession> for StoredSession
type Storage = PhantomData<&'a StoredSession>
Source§fn to_glib_none(&'a self) -> Stash<'a, *const StoredSession, Self>
fn to_glib_none(&'a self) -> Stash<'a, *const StoredSession, Self>
Source§fn to_glib_full(&self) -> *const StoredSession
fn to_glib_full(&self) -> *const StoredSession
Source§fn to_glib_container(&'a self) -> Stash<'a, P, Self>
fn to_glib_container(&'a self) -> Stash<'a, P, Self>
Source§impl<'a> ToGlibPtr<'a, *mut StoredSession> for StoredSession
impl<'a> ToGlibPtr<'a, *mut StoredSession> for StoredSession
type Storage = PhantomData<&'a StoredSession>
Source§fn to_glib_none(&'a self) -> Stash<'a, *mut StoredSession, Self>
fn to_glib_none(&'a self) -> Stash<'a, *mut StoredSession, Self>
Source§fn to_glib_full(&self) -> *mut StoredSession
fn to_glib_full(&self) -> *mut StoredSession
Source§fn to_glib_container(&'a self) -> Stash<'a, P, Self>
fn to_glib_container(&'a self) -> Stash<'a, P, Self>
Source§impl ToValue for StoredSession
impl ToValue for StoredSession
Source§impl TransparentType for StoredSession
impl TransparentType for StoredSession
type GlibType = StoredSession
Source§impl ValueType for StoredSession
impl ValueType for StoredSession
Source§type Type = StoredSession
type Type = StoredSession
Type from. Read moreAuto Trait Implementations§
impl Freeze for StoredSession
impl RefUnwindSafe for StoredSession
impl Send for StoredSession
impl Sync for StoredSession
impl Unpin for StoredSession
impl UnsafeUnpin for StoredSession
impl UnwindSafe for StoredSession
Blanket Implementations§
impl<T> AsyncTraitDeps for Twhere
T: Debug + SendOutsideWasm + SyncOutsideWasm,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
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 moreimpl<T> JsonCastable<CanonicalJsonValue> for T
impl<T> JsonCastable<Value> for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> SendOutsideWasm for Twhere
T: Send,
Source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
Source§fn ensure_type()
fn ensure_type()
impl<T> SyncOutsideWasm for Twhere
T: Sync,
Source§impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T
impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T
type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice( t: &'a [T], ) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
fn to_glib_container_from_slice( _t: &'a [T], ) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
fn to_glib_full_from_slice(_t: &[T]) -> *const GList
Source§impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T
impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T
type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice( t: &'a [T], ) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
fn to_glib_container_from_slice( _t: &'a [T], ) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
fn to_glib_full_from_slice(_t: &[T]) -> *const GPtrArray
Source§impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T
type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice( t: &'a [T], ) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
fn to_glib_container_from_slice( t: &'a [T], ) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GList
Source§impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T
type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice( t: &'a [T], ) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
fn to_glib_container_from_slice( t: &'a [T], ) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GPtrArray
Source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
Source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue clone of self.