chore(sdk): Rename event_cache/store.rs to event_cache/room/events.rs.

This patch renames the `store.rs` file to `room/events.rs`.
This commit is contained in:
Ivan Enderlin
2024-10-28 15:27:23 +01:00
parent b66024c386
commit 2f19e2b762
4 changed files with 22 additions and 14 deletions

View File

@@ -58,13 +58,13 @@ use tracing::{error, info_span, instrument, trace, warn, Instrument as _, Span};
use self::{
paginator::PaginatorError,
store::{Gap, RoomEvents},
room::events::{Gap, RoomEvents},
};
use crate::{client::WeakClient, room::WeakRoom, Client};
mod linked_chunk;
mod pagination;
mod store;
mod room;
pub mod paginator;
pub use pagination::{RoomPagination, TimelineHasBeenResetWhilePaginating};

View File

@@ -22,11 +22,11 @@ use tokio::time::timeout;
use tracing::{debug, instrument, trace};
use super::{
linked_chunk::ChunkContent,
paginator::{PaginationResult, PaginatorState},
store::Gap,
room::events::{Gap, RoomEvents},
BackPaginationOutcome, Result, RoomEventCacheInner,
};
use crate::event_cache::{linked_chunk::ChunkContent, store::RoomEvents};
/// An API object to run pagination queries on a [`super::RoomEventCache`].
///
@@ -321,7 +321,7 @@ mod tests {
use tokio::{spawn, time::sleep};
use crate::{
deserialized_responses::SyncTimelineEvent, event_cache::store::Gap,
deserialized_responses::SyncTimelineEvent, event_cache::room::events::Gap,
test_utils::logged_in_client,
};

View File

@@ -12,11 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::fmt;
use matrix_sdk_common::deserialized_responses::SyncTimelineEvent;
use super::linked_chunk::{Chunk, ChunkIdentifier, Error, Iter, LinkedChunk, Position};
use super::super::linked_chunk::{Chunk, ChunkIdentifier, Error, Iter, LinkedChunk, Position};
/// An alias for the real event type.
pub(crate) type Event = SyncTimelineEvent;
@@ -31,6 +29,7 @@ pub struct Gap {
const DEFAULT_CHUNK_CAPACITY: usize = 128;
/// This type represents all events of a single room.
#[derive(Debug)]
pub struct RoomEvents {
/// The real in-memory storage for all the events.
chunks: LinkedChunk<DEFAULT_CHUNK_CAPACITY, Event, Gap>,
@@ -132,12 +131,6 @@ impl RoomEvents {
}
}
impl fmt::Debug for RoomEvents {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
formatter.debug_struct("RoomEvents").field("chunk", &self.chunks).finish()
}
}
#[cfg(test)]
mod tests {
use assert_matches2::assert_let;

View File

@@ -0,0 +1,15 @@
// Copyright 2024 The Matrix.org Foundation C.I.C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub(super) mod events;