Skip to content

Commit 8c12288

Browse files
committed
refactor: Move Event and Gap into matrix_sdk_base::event_cache.
1 parent f2b2188 commit 8c12288

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,5 +14,18 @@
1414

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

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 ruma::OwnedEventId;
1919
use tracing::{debug, error, warn};
2020

@@ -23,16 +23,6 @@ use super::super::{
2323
linked_chunk::{Chunk, ChunkIdentifier, EmptyChunk, Error, Iter, LinkedChunk, Position},
2424
};
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)