Hot-Reloading Refactor
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
ae1a4fd283
commit
6c1434c165
212 changed files with 5679 additions and 4206 deletions
|
@ -1,45 +1,43 @@
|
|||
mod data;
|
||||
|
||||
pub(crate) use data::Data;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use data::Data;
|
||||
use ruma::{OwnedRoomId, OwnedUserId, RoomId, UserId};
|
||||
|
||||
use crate::Result;
|
||||
|
||||
pub(crate) struct Service {
|
||||
pub(crate) db: &'static dyn Data,
|
||||
pub struct Service {
|
||||
pub db: Arc<dyn Data>,
|
||||
}
|
||||
|
||||
impl Service {
|
||||
pub(crate) fn reset_notification_counts(&self, user_id: &UserId, room_id: &RoomId) -> Result<()> {
|
||||
pub fn reset_notification_counts(&self, user_id: &UserId, room_id: &RoomId) -> Result<()> {
|
||||
self.db.reset_notification_counts(user_id, room_id)
|
||||
}
|
||||
|
||||
pub(crate) fn notification_count(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64> {
|
||||
pub fn notification_count(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64> {
|
||||
self.db.notification_count(user_id, room_id)
|
||||
}
|
||||
|
||||
pub(crate) fn highlight_count(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64> {
|
||||
pub fn highlight_count(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64> {
|
||||
self.db.highlight_count(user_id, room_id)
|
||||
}
|
||||
|
||||
pub(crate) fn last_notification_read(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64> {
|
||||
pub fn last_notification_read(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64> {
|
||||
self.db.last_notification_read(user_id, room_id)
|
||||
}
|
||||
|
||||
pub(crate) fn associate_token_shortstatehash(
|
||||
&self, room_id: &RoomId, token: u64, shortstatehash: u64,
|
||||
) -> Result<()> {
|
||||
pub fn associate_token_shortstatehash(&self, room_id: &RoomId, token: u64, shortstatehash: u64) -> Result<()> {
|
||||
self.db
|
||||
.associate_token_shortstatehash(room_id, token, shortstatehash)
|
||||
}
|
||||
|
||||
pub(crate) fn get_token_shortstatehash(&self, room_id: &RoomId, token: u64) -> Result<Option<u64>> {
|
||||
pub fn get_token_shortstatehash(&self, room_id: &RoomId, token: u64) -> Result<Option<u64>> {
|
||||
self.db.get_token_shortstatehash(room_id, token)
|
||||
}
|
||||
|
||||
pub(crate) fn get_shared_rooms(
|
||||
&self, users: Vec<OwnedUserId>,
|
||||
) -> Result<impl Iterator<Item = Result<OwnedRoomId>>> {
|
||||
pub fn get_shared_rooms(&self, users: Vec<OwnedUserId>) -> Result<impl Iterator<Item = Result<OwnedRoomId>> + '_> {
|
||||
self.db.get_shared_rooms(users)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue