pub struct AvatarImage {
session: OnceCell<Session>,
uri: RefCell<Option<OwnedMxcUri>>,
uri_string: PhantomData<Option<String>>,
info: RefCell<Option<ImageInfo>>,
uri_source: Cell<AvatarUriSource>,
scale_factor: Cell<u32>,
small_paintable_ref: OnceCell<CountedRef>,
small_paintable: RefCell<Option<Paintable>>,
big_paintable_ref: OnceCell<CountedRef>,
big_paintable: RefCell<Option<Paintable>>,
pub(super) error: Cell<Option<ImageError>>,
}
Fields§
§session: OnceCell<Session>
The current session.
uri: RefCell<Option<OwnedMxcUri>>
The Matrix URI of the avatar.
uri_string: PhantomData<Option<String>>
The Matrix URI of the AvatarImage
, as a string.
info: RefCell<Option<ImageInfo>>
Information about the avatar.
uri_source: Cell<AvatarUriSource>
The source of the URI avatar.
scale_factor: Cell<u32>
The scale factor to use to load the cached paintable.
small_paintable_ref: OnceCell<CountedRef>
The counted reference for the small paintable.
The small paintable is cached indefinitely after the first reference is taken.
small_paintable: RefCell<Option<Paintable>>
The cached paintable of the avatar at small size, if any.
big_paintable_ref: OnceCell<CountedRef>
The counted reference for the big paintable.
The big paintable is cached after the first reference is taken and dropped when the last reference is dropped.
big_paintable: RefCell<Option<Paintable>>
The cached paintable of the avatar at big size, if any.
error: Cell<Option<ImageError>>
The last error encountered when loading the cached paintable of the avatar, if any.
Implementations§
Source§impl AvatarImage
impl AvatarImage
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl AvatarImage
impl AvatarImage
Sourcepub(super) fn uri(&self) -> Option<OwnedMxcUri>
pub(super) fn uri(&self) -> Option<OwnedMxcUri>
The Matrix URI of the AvatarImage
.
Sourcepub(super) fn set_uri(&self, uri: Option<OwnedMxcUri>)
pub(super) fn set_uri(&self, uri: Option<OwnedMxcUri>)
Set the Matrix URI of the AvatarImage
.
Returns whether the URI changed.
Sourcefn uri_string(&self) -> Option<String>
fn uri_string(&self) -> Option<String>
The Matrix URI of the AvatarImage
, as a string.
Sourcefn set_scale_factor(&self, scale_factor: u32)
fn set_scale_factor(&self, scale_factor: u32)
Set the scale factor to use to load the cached paintable.
Only the biggest size will be stored.
Sourcepub(super) fn small_paintable_ref(&self) -> &CountedRef
pub(super) fn small_paintable_ref(&self) -> &CountedRef
The counted reference for the small paintable.
Sourcepub(super) async fn load_small_paintable(&self, high_priority: bool)
pub(super) async fn load_small_paintable(&self, high_priority: bool)
Load the small paintable.
Sourcepub(super) fn big_paintable_ref(&self) -> &CountedRef
pub(super) fn big_paintable_ref(&self) -> &CountedRef
The counted reference for the big paintable.
Sourceasync fn load_big_paintable(&self)
async fn load_big_paintable(&self)
Load the big paintable.
Sourcefn set_error(&self, error: Option<ImageError>)
fn set_error(&self, error: Option<ImageError>)
Set the error encountered when loading the avatar, if any.
Sourceasync fn load(
&self,
size: AvatarPaintableSize,
priority: ImageRequestPriority,
) -> Result<Option<Paintable>, ImageError>
async fn load( &self, size: AvatarPaintableSize, priority: ImageRequestPriority, ) -> Result<Option<Paintable>, ImageError>
Load a paintable of the avatar for the given size.
Trait Implementations§
Source§impl Debug for AvatarImage
impl Debug for AvatarImage
Source§impl Default for AvatarImage
impl Default for AvatarImage
Source§impl DerivedObjectProperties for AvatarImage
impl DerivedObjectProperties for AvatarImage
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 AvatarImage
impl ObjectImpl for AvatarImage
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 constructed(&self)
fn constructed(&self)
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 AvatarImage
impl ObjectSubclass for AvatarImage
Source§type ParentType = Object
type ParentType = Object
Source§type Interfaces = ()
type Interfaces = ()
Source§type Class = ClassStruct<AvatarImage>
type Class = ClassStruct<AvatarImage>
Source§type Instance = InstanceStruct<AvatarImage>
type Instance = InstanceStruct<AvatarImage>
Source§type Type = AvatarImage
type Type = AvatarImage
wrapper!
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>)
Auto Trait Implementations§
impl !Freeze for AvatarImage
impl !RefUnwindSafe for AvatarImage
impl !Send for AvatarImage
impl !Sync for AvatarImage
impl Unpin for AvatarImage
impl !UnwindSafe for AvatarImage
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 instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Source§fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
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
.