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: Url
The URL of the homeserver where the account lives.
user_id: OwnedUserId
The unique identifier of the user.
device_id: OwnedDeviceId
The unique identifier of the session on the homeserver.
id: String
The 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
Sourceasync fn try_from_secret_item(item: Item) -> Result<Self, LinuxSecretError>
async fn try_from_secret_item(item: Item) -> Result<Self, LinuxSecretError>
Build self from an item.
Sourcefn attributes(&self) -> HashMap<&'static str, String>
fn attributes(&self) -> HashMap<&'static str, String>
Get the attributes from self
.
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 · 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 &'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<'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 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§unsafe fn into_glib_ptr(self) -> *mut StoredSession
unsafe 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 UnwindSafe for StoredSession
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<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 moreSource§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere
T: HasParamSpec,
Source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
Source§fn ensure_type()
fn ensure_type()
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
.