pub struct HistoryViewerTimeline {
room: OnceCell<Room>,
state: Cell<LoadingState>,
has_reached_start: Cell<bool>,
list: RefCell<Vec<HistoryViewerEvent>>,
last_token: RefCell<Option<String>>,
model_with_loading_item: OnceCell<FlattenListModel>,
loading_item_model: OnceCell<SingleItemListModel>,
}
Fields§
§room: OnceCell<Room>
The room that this timeline belongs to.
state: Cell<LoadingState>
The loading state of this timeline.
has_reached_start: Cell<bool>
Whether we have reached the start of the timeline.
list: RefCell<Vec<HistoryViewerEvent>>
§last_token: RefCell<Option<String>>
§model_with_loading_item: OnceCell<FlattenListModel>
A wrapper model with an extra loading item at the end when applicable.
The loading item is a LoadingRow
, all other items are
HistoryViewerEvent
s.
loading_item_model: OnceCell<SingleItemListModel>
A model containing a LoadingRow
when the timeline is loading.
Implementations§
Source§impl HistoryViewerTimeline
impl HistoryViewerTimeline
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl HistoryViewerTimeline
impl HistoryViewerTimeline
Sourcefn set_state(&self, state: LoadingState)
fn set_state(&self, state: LoadingState)
Set the loading state of the timeline.
Sourcepub(super) fn set_has_reached_start(&self, has_reached_start: bool)
pub(super) fn set_has_reached_start(&self, has_reached_start: bool)
Set whether we have reached the start of the timeline.
Sourcepub(super) fn append(&self, batch: Vec<HistoryViewerEvent>)
pub(super) fn append(&self, batch: Vec<HistoryViewerEvent>)
Append the given batch to the timeline.
Sourcepub(super) fn loading_item_model(&self) -> &SingleItemListModel
pub(super) fn loading_item_model(&self) -> &SingleItemListModel
A model containing a LoadingRow
when the timeline is loading.
Sourcepub(super) fn model_with_loading_item(&self) -> &FlattenListModel
pub(super) fn model_with_loading_item(&self) -> &FlattenListModel
A wrapper model with an extra loading item at the end when applicable.
The loading item is a LoadingRow
, all other items are
HistoryViewerEvent
s.
Sourcepub(super) async fn load<F>(&self, continue_fn: F)
pub(super) async fn load<F>(&self, continue_fn: F)
Load more events in the timeline until the given function tells us to stop.
Sourceasync fn load_inner(&self) -> bool
async fn load_inner(&self) -> bool
Load more events in the timeline.
Returns true
if more events can be loaded.
Trait Implementations§
Source§impl Debug for HistoryViewerTimeline
impl Debug for HistoryViewerTimeline
Source§impl Default for HistoryViewerTimeline
impl Default for HistoryViewerTimeline
Source§fn default() -> HistoryViewerTimeline
fn default() -> HistoryViewerTimeline
Source§impl DerivedObjectProperties for HistoryViewerTimeline
impl DerivedObjectProperties for HistoryViewerTimeline
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 HistoryViewerTimeline
impl ObjectImpl for HistoryViewerTimeline
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 HistoryViewerTimeline
impl ObjectSubclass for HistoryViewerTimeline
Source§type ParentType = Object
type ParentType = Object
Source§type Class = ClassStruct<HistoryViewerTimeline>
type Class = ClassStruct<HistoryViewerTimeline>
Source§type Instance = InstanceStruct<HistoryViewerTimeline>
type Instance = InstanceStruct<HistoryViewerTimeline>
Source§type Type = HistoryViewerTimeline
type Type = HistoryViewerTimeline
wrapper!
Source§type Interfaces = (ListModel,)
type Interfaces = (ListModel,)
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 HistoryViewerTimeline
impl !RefUnwindSafe for HistoryViewerTimeline
impl !Send for HistoryViewerTimeline
impl !Sync for HistoryViewerTimeline
impl Unpin for HistoryViewerTimeline
impl !UnwindSafe for HistoryViewerTimeline
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> ListModelImplExt for Twhere
T: ListModelImpl,
impl<T> ListModelImplExt for Twhere
T: ListModelImpl,
fn parent_item_type(&self) -> Type
fn parent_n_items(&self) -> u32
fn parent_item(&self, position: u32) -> Option<Object>
Source§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
.