Skip to content

Commit 181eb62

Browse files
committed
refactor: Move Event and Gap into matrix_sdk_base::event_cache.
1 parent 34232ee commit 181eb62

File tree

2 files changed

+14
-11
lines changed
  • crates
    • matrix-sdk/src/event_cache/room
    • matrix-sdk-base/src/event_cache

2 files changed

+14
-11
lines changed

crates/matrix-sdk-base/src/event_cache/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,17 @@
1414

1515
//! Event cache store and common types shared with `matrix_sdk::event_cache`.
1616
17+
use matrix_sdk_common::deserialized_responses::SyncTimelineEvent;
18+
1719
pub mod store;
20+
21+
/// The kind of event the event storage holds.
22+
pub type Event = SyncTimelineEvent;
23+
24+
/// The kind of gap the event storage holds.
25+
#[derive(Clone, Debug)]
26+
pub struct Gap {
27+
/// The token to use in the query, extracted from a previous "from" /
28+
/// "end" field of a `/messages` response.
29+
pub prev_token: String,
30+
}

crates/matrix-sdk/src/event_cache/room/events.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::cmp::Ordering;
1616

17-
use matrix_sdk_common::deserialized_responses::SyncTimelineEvent;
17+
pub use matrix_sdk_base::event_cache::{Event, Gap};
1818
use matrix_sdk_common::linked_chunk::{
1919
Chunk, ChunkIdentifier, EmptyChunk, Error, Iter, LinkedChunk, Position,
2020
};
@@ -23,16 +23,6 @@ use tracing::{debug, error, warn};
2323

2424
use super::super::deduplicator::{Decoration, Deduplicator};
2525

26-
/// An alias for the real event type.
27-
pub(crate) type Event = SyncTimelineEvent;
28-
29-
#[derive(Clone, Debug)]
30-
pub struct Gap {
31-
/// The token to use in the query, extracted from a previous "from" /
32-
/// "end" field of a `/messages` response.
33-
pub prev_token: String,
34-
}
35-
3626
const DEFAULT_CHUNK_CAPACITY: usize = 128;
3727

3828
/// This type represents all events of a single room.

0 commit comments

Comments
 (0)