pub struct UserSession {
session: WeakRef<Session>,
data: OnceCell<UserSessionData>,
is_current: Cell<bool>,
device_id: PhantomData<String>,
display_name: PhantomData<String>,
last_seen_ip: PhantomData<Option<String>>,
last_seen_ts: PhantomData<Option<DateTime>>,
verified: PhantomData<bool>,
}
Fields§
§session: WeakRef<Session>
The current session.
data: OnceCell<UserSessionData>
The user session data.
is_current: Cell<bool>
Whether this is the current user session.
device_id: PhantomData<String>
The ID of the user session.
display_name: PhantomData<String>
The display name of the user session.
last_seen_ip: PhantomData<Option<String>>
The last IP address used by the user session.
last_seen_ts: PhantomData<Option<DateTime>>
The last time the user session was used.
verified: PhantomData<bool>
Whether this user session is verified.
Implementations§
Source§impl UserSession
impl UserSession
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl UserSession
impl UserSession
Sourcepub(super) fn set_data(&self, data: UserSessionData)
pub(super) fn set_data(&self, data: UserSessionData)
Set the user session data.
Sourcepub(super) fn data(&self) -> &UserSessionData
pub(super) fn data(&self) -> &UserSessionData
The user session data.
Sourcefn display_name(&self) -> String
fn display_name(&self) -> String
The display name of the device.
Sourcefn last_seen_ip(&self) -> Option<String>
fn last_seen_ip(&self) -> Option<String>
The last IP address used by the user session.
Sourcefn last_seen_ts(&self) -> Option<DateTime>
fn last_seen_ts(&self) -> Option<DateTime>
The last time the user session was used.
Trait Implementations§
Source§impl Debug for UserSession
impl Debug for UserSession
Source§impl Default for UserSession
impl Default for UserSession
Source§fn default() -> UserSession
fn default() -> UserSession
Returns the “default value” for a type. Read more
Source§impl DerivedObjectProperties for UserSession
impl DerivedObjectProperties for UserSession
Source§fn derived_properties() -> &'static [ParamSpec]
fn derived_properties() -> &'static [ParamSpec]
Properties installed for this type.
Source§fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
Similar to
ObjectImpl
but auto-generated by the Properties
macro
to allow handling more complex use-cases.Source§fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
Similar to
ObjectImpl
but auto-generated by the Properties
macro
to allow handling more complex use-cases.Source§impl ObjectImpl for UserSession
impl ObjectImpl for UserSession
Source§fn properties() -> &'static [ParamSpec]
fn properties() -> &'static [ParamSpec]
Properties installed for this type.
Source§fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
Property setter. Read more
Source§fn constructed(&self)
fn constructed(&self)
Constructed. Read more
Source§fn notify(&self, pspec: &ParamSpec)
fn notify(&self, pspec: &ParamSpec)
Function to be called when property change is notified for with
self.notify("property")
.fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])
Source§impl ObjectSubclass for UserSession
impl ObjectSubclass for UserSession
Source§type ParentType = Object
type ParentType = Object
Parent Rust type to inherit from.
Source§type Interfaces = ()
type Interfaces = ()
List of interfaces implemented by this type.
Source§type Class = ClassStruct<UserSession>
type Class = ClassStruct<UserSession>
The C class struct. Read more
Source§type Instance = InstanceStruct<UserSession>
type Instance = InstanceStruct<UserSession>
The C instance struct. Read more
Source§type Type = UserSession
type Type = UserSession
Wrapper around this subclass defined with
wrapper!
Source§const ALLOW_NAME_CONFLICT: bool = false
const ALLOW_NAME_CONFLICT: bool = false
Allow name conflicts for this class. Read more
Source§fn type_init(_type_: &mut InitializingType<Self>)
fn type_init(_type_: &mut InitializingType<Self>)
Additional type initialization. Read more
Source§fn class_init(_klass: &mut Self::Class)
fn class_init(_klass: &mut Self::Class)
Class initialization. Read more
Source§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
Constructor. Read more
Source§fn instance_init(_obj: &InitializingObject<Self>)
fn instance_init(_obj: &InitializingObject<Self>)
Performs additional instance initialization. Read more
Auto Trait Implementations§
impl !Freeze for UserSession
impl !RefUnwindSafe for UserSession
impl !Send for UserSession
impl !Sync for UserSession
impl Unpin for UserSession
impl !UnwindSafe for UserSession
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, 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> 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 moreSource§impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
Source§fn parent_constructed(&self)
fn parent_constructed(&self)
Chain up to the parent class’ implementation of
glib::Object::constructed()
.Source§fn parent_notify(&self, pspec: &ParamSpec)
fn parent_notify(&self, pspec: &ParamSpec)
Chain up to the parent class’ implementation of
glib::Object::notify()
.Source§fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
Chain up to the parent class’ implementation of
glib::Object::dispatch_properties_changed()
.Source§fn signal_chain_from_overridden(
&self,
token: &SignalClassHandlerToken,
values: &[Value],
) -> Option<Value>
fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>
Chain up to parent class signal handler.
Source§impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
Source§fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
👎Deprecated: Use obj() instead
Returns the corresponding object instance.
Source§fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
👎Deprecated: Use from_obj() instead
Returns the implementation from an instance.
Source§fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Returns the corresponding object instance. Read more
Source§fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
Returns the implementation from an instance. Read more
Source§fn ref_counted(&self) -> ObjectImplRef<T>
fn ref_counted(&self) -> ObjectImplRef<T>
Returns a new reference-counted wrapper around
self
.