mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 23:15:08 -04:00
refactor: Move Event and Gap into matrix_sdk_base::event_cache.
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user