fractal::secret

Struct StoredSession

source
pub struct StoredSession {
    pub homeserver: Url,
    pub user_id: OwnedUserId,
    pub device_id: OwnedDeviceId,
    pub id: String,
    pub secret: Secret,
}
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.

§secret: Secret

The secrets of the session.

Implementations§

source§

impl StoredSession

source

async fn try_from_secret_item(item: Item) -> Result<Self, LinuxSecretError>

Build self from a secret.

source

fn attributes(&self) -> HashMap<&'static str, String>

Get the attributes from self.

source

async fn apply_migrations( &mut self, from_version: u8, attributes: HashMap<String, String>, )

Migrate this session to the current version.

source§

impl StoredSession

source

pub fn with_login_data(homeserver: Url, data: MatrixSession) -> Result<Self, ()>

Construct a StoredSession from the given login data.

Returns an error if we failed to generate a unique session ID for the new session.

source

pub fn data_path(&self) -> PathBuf

The path where the persistent data of this session lives.

source

pub fn cache_path(&self) -> PathBuf

The path where the cached data of this session lives.

source

pub async fn delete(self)

Delete this session from the system.

Trait Implementations§

source§

impl BoxedType for StoredSession

source§

const NAME: &'static str = "StoredSession"

Boxed type name. Read more
source§

const ALLOW_NAME_CONFLICT: bool = false

Allow name conflicts for this boxed type. Read more
source§

impl Clone for StoredSession

source§

fn clone(&self) -> StoredSession

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StoredSession

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<StoredSession> for Value

source§

fn from(v: StoredSession) -> Self

Converts to this type from the input type.
source§

impl FromGlibPtrBorrow<*const StoredSession> for StoredSession

source§

impl FromGlibPtrBorrow<*mut StoredSession> for StoredSession

source§

impl FromGlibPtrFull<*mut StoredSession> for StoredSession

source§

impl FromGlibPtrNone<*const StoredSession> for StoredSession

source§

impl FromGlibPtrNone<*mut StoredSession> for StoredSession

source§

impl<'a> FromValue<'a> for &'a StoredSession

source§

type Checker = GenericValueTypeChecker<&'a StoredSession>

Value type checker.
source§

unsafe fn from_value(value: &'a Value) -> Self

Get the contained value from a Value. Read more
source§

impl<'a> FromValue<'a> for StoredSession

source§

type Checker = GenericValueTypeChecker<StoredSession>

Value type checker.
source§

unsafe fn from_value(value: &'a Value) -> Self

Get the contained value from a Value. Read more
source§

impl GlibPtrDefault for StoredSession

source§

impl HasParamSpec for StoredSession

source§

type ParamSpec = ParamSpecBoxed

source§

type SetValue = StoredSession

Preferred value to be used as setter for the associated ParamSpec.
source§

type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, StoredSession>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl IntoGlibPtr<*mut StoredSession> for StoredSession

source§

unsafe fn into_glib_ptr(self) -> *mut StoredSession

Transfer: full.
source§

impl StaticType for StoredSession

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl<'a> ToGlibPtr<'a, *const StoredSession> for StoredSession

source§

type Storage = PhantomData<&'a StoredSession>

source§

fn to_glib_none(&'a self) -> Stash<'a, *const StoredSession, Self>

Transfer: none. Read more
source§

fn to_glib_full(&self) -> *const StoredSession

Transfer: full. Read more
source§

fn to_glib_container(&'a self) -> Stash<'a, P, Self>

Transfer: container. Read more
source§

impl<'a> ToGlibPtr<'a, *mut StoredSession> for StoredSession

source§

type Storage = PhantomData<&'a StoredSession>

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut StoredSession, Self>

Transfer: none. Read more
source§

fn to_glib_full(&self) -> *mut StoredSession

Transfer: full. Read more
source§

fn to_glib_container(&'a self) -> Stash<'a, P, Self>

Transfer: container. Read more
source§

impl ToValue for StoredSession

source§

fn to_value(&self) -> Value

Convert a value to a Value.
source§

fn value_type(&self) -> Type

Returns the type identifier of self. Read more
source§

impl ValueType for StoredSession

source§

type Type = StoredSession

Type to get the Type from. Read more
source§

impl TransparentPtrType for StoredSession

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

source§

const WITNESS: W = W::MAKE

A constant of the type witness
source§

impl<T> Identity for T
where T: ?Sized,

source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Property for T
where T: HasParamSpec,

source§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

source§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToSendValue for T
where T: Send + ToValue + ?Sized,

source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
source§

impl<T> TransparentType for T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Any for T
where T: Any,

source§

impl<T> AsyncTraitDeps for T

source§

impl<T> CloneAny for T
where T: Any + Clone,

source§

impl<T> CloneAnySend for T
where T: Any + Send + Clone,

source§

impl<T> CloneAnySendSync for T
where T: Any + Send + Sync + Clone,

source§

impl<T> CloneAnySync for T
where T: Any + Sync + Clone,

source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

source§

impl<T> SendOutsideWasm for T
where T: Send,

source§

impl<T> SyncOutsideWasm for T
where T: Sync,