pub struct User {
user_id: OnceCell<OwnedUserId>,
user_id_string: PhantomData<String>,
session: OnceCell<Session>,
is_own_user: Cell<bool>,
pub(super) has_display_name: Cell<bool>,
is_verified: Cell<bool>,
is_ignored: Cell<bool>,
ignored_handler: RefCell<Option<SignalHandlerId>>,
}Fields§
§user_id: OnceCell<OwnedUserId>The ID of this user.
user_id_string: PhantomData<String>The ID of this user, as a string.
session: OnceCell<Session>The current session.
is_own_user: Cell<bool>Whether this user is the same as the session’s user.
has_display_name: Cell<bool>Whether this user has a display name set.
If the display name is not set, the display-name property returns
the localpart of the user ID.
is_verified: Cell<bool>Whether this user has been verified.
is_ignored: Cell<bool>Whether this user is currently ignored.
ignored_handler: RefCell<Option<SignalHandlerId>>Implementations§
Source§impl User
impl User
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl User
impl User
Sourcepub(super) fn user_id(&self) -> &OwnedUserId
pub(super) fn user_id(&self) -> &OwnedUserId
The ID of this user.
Sourcefn user_id_string(&self) -> String
fn user_id_string(&self) -> String
The ID of this user, as a string.
Sourcepub(crate) fn set_user_id(&self, user_id: OwnedUserId)
pub(crate) fn set_user_id(&self, user_id: OwnedUserId)
Set the ID of this user.
Sourcepub(super) fn set_has_display_name(&self, has_display_name: bool)
pub(super) fn set_has_display_name(&self, has_display_name: bool)
Set whether this user has a display name set.
Sourcepub(super) async fn local_crypto_identity(&self) -> Option<UserIdentity>
pub(super) async fn local_crypto_identity(&self) -> Option<UserIdentity>
Get the local cryptographic identity (aka cross-signing identity) of this user.
Locally, we should always have the crypto identity of our own user and of users with whom we share an encrypted room.
Sourceasync fn init_is_verified(&self)
async fn init_is_verified(&self)
Load whether this user is verified.
Sourcepub(super) async fn create_direct_chat(&self) -> Result<Room, Error>
pub(super) async fn create_direct_chat(&self) -> Result<Room, Error>
Create an encrypted direct chat with this user.
Trait Implementations§
Source§impl DerivedObjectProperties for User
impl DerivedObjectProperties for User
Source§fn derived_properties() -> &'static [ParamSpec]
fn derived_properties() -> &'static [ParamSpec]
Source§fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
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)
ObjectImpl but auto-generated by the Properties macro
to allow handling more complex use-cases.Source§impl ObjectImpl for User
impl ObjectImpl for User
Source§fn constructed(&self)
fn constructed(&self)
Source§fn properties() -> &'static [ParamSpec]
fn properties() -> &'static [ParamSpec]
Source§fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
Source§fn notify(&self, pspec: &ParamSpec)
fn notify(&self, pspec: &ParamSpec)
self.notify("property").fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])
Source§impl ObjectSubclass for User
impl ObjectSubclass for User
Source§type Interfaces = ()
type Interfaces = ()
Source§type ParentType = PillSource
type ParentType = PillSource
Source§const ALLOW_NAME_CONFLICT: bool = false
const ALLOW_NAME_CONFLICT: bool = false
Source§fn type_init(_type_: &mut InitializingType<Self>)
fn type_init(_type_: &mut InitializingType<Self>)
Source§fn class_init(_klass: &mut Self::Class)
fn class_init(_klass: &mut Self::Class)
Source§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
Source§fn instance_init(_obj: &InitializingObject<Self>)
fn instance_init(_obj: &InitializingObject<Self>)
Source§impl ObjectSubclassType for User
impl ObjectSubclassType for User
Source§impl PillSourceImpl for User
impl PillSourceImpl for User
Source§fn identifier(&self) -> String
fn identifier(&self) -> String
Auto Trait Implementations§
impl !Freeze for User
impl !RefUnwindSafe for User
impl !Send for User
impl !Sync for User
impl Unpin for User
impl !UnwindSafe for User
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, 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>
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> ObjectImplExt for Twhere
T: ObjectImpl,
impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
Source§fn parent_constructed(&self)
fn parent_constructed(&self)
glib::Object::constructed().Source§fn parent_notify(&self, pspec: &ParamSpec)
fn parent_notify(&self, pspec: &ParamSpec)
glib::Object::notify().Source§fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
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>
Source§impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
Source§fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Source§fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
Source§fn ref_counted(&self) -> ObjectImplRef<T>
fn ref_counted(&self) -> ObjectImplRef<T>
self.