refactor: Move Event and Gap into matrix_sdk_base::event_cache.

This commit is contained in:
Ivan Enderlin
2024-11-11 17:17:09 +01:00
parent c3e28f7e33
commit aca83fb4ed
2 changed files with 14 additions and 11 deletions

View File

@@ -14,4 +14,17 @@
//! Event cache store and common types shared with `matrix_sdk::event_cache`.
use matrix_sdk_common::deserialized_responses::SyncTimelineEvent;
pub mod store;
/// The kind of event the event storage holds.
pub type Event = SyncTimelineEvent;
/// The kind of gap the event storage holds.
#[derive(Clone, Debug)]
pub struct Gap {
/// The token to use in the query, extracted from a previous "from" /
/// "end" field of a `/messages` response.
pub prev_token: String,
}

View File

@@ -14,7 +14,7 @@
use std::cmp::Ordering;
use matrix_sdk_common::deserialized_responses::SyncTimelineEvent;
pub use matrix_sdk_base::event_cache::{Event, Gap};
use matrix_sdk_common::linked_chunk::{
Chunk, ChunkIdentifier, EmptyChunk, Error, Iter, LinkedChunk, Position,
};
@@ -23,16 +23,6 @@ use tracing::{debug, error, warn};
use super::super::deduplicator::{Decoration, Deduplicator};
/// An alias for the real event type.
pub(crate) type Event = SyncTimelineEvent;
#[derive(Clone, Debug)]
pub struct Gap {
/// The token to use in the query, extracted from a previous "from" /
/// "end" field of a `/messages` response.
pub prev_token: String,
}
const DEFAULT_CHUNK_CAPACITY: usize = 128;
/// This type represents all events of a single room.