0 errors left!
This commit is contained in:
parent
f47a5cd5d5
commit
d5b4754cf4
59 changed files with 656 additions and 563 deletions
|
@ -3,6 +3,7 @@ use ruma::RoomId;
|
|||
|
||||
pub trait Data: Send + Sync {
|
||||
fn exists(&self, room_id: &RoomId) -> Result<bool>;
|
||||
fn iter_ids<'a>(&'a self) -> Box<dyn Iterator<Item = Result<Box<RoomId>>> + 'a>;
|
||||
fn is_disabled(&self, room_id: &RoomId) -> Result<bool>;
|
||||
fn disable_room(&self, room_id: &RoomId, disabled: bool) -> Result<()>;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use ruma::RoomId;
|
|||
use crate::Result;
|
||||
|
||||
pub struct Service {
|
||||
db: Arc<dyn Data>,
|
||||
pub db: &'static dyn Data,
|
||||
}
|
||||
|
||||
impl Service {
|
||||
|
@ -17,6 +17,10 @@ impl Service {
|
|||
self.db.exists(room_id)
|
||||
}
|
||||
|
||||
pub fn iter_ids<'a>(&'a self) -> Box<dyn Iterator<Item = Result<Box<RoomId>>> + 'a> {
|
||||
self.db.iter_ids()
|
||||
}
|
||||
|
||||
pub fn is_disabled(&self, room_id: &RoomId) -> Result<bool> {
|
||||
self.db.is_disabled(room_id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue