mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-12 02:09:00 -05:00
31 lines
754 B
Rust
31 lines
754 B
Rust
mod data;
|
|
pub use data::Data;
|
|
use ruma::RoomId;
|
|
|
|
use crate::Result;
|
|
|
|
pub struct Service<D: Data> {
|
|
db: D,
|
|
}
|
|
|
|
impl<D: Data> Service<D> {
|
|
#[tracing::instrument(skip(self))]
|
|
pub fn set_public(&self, room_id: &RoomId) -> Result<()> {
|
|
self.db.set_public(room_id)
|
|
}
|
|
|
|
#[tracing::instrument(skip(self))]
|
|
pub fn set_not_public(&self, room_id: &RoomId) -> Result<()> {
|
|
self.db.set_not_public(room_id)
|
|
}
|
|
|
|
#[tracing::instrument(skip(self))]
|
|
pub fn is_public_room(&self, room_id: &RoomId) -> Result<bool> {
|
|
self.db.is_public_room(room_id)
|
|
}
|
|
|
|
#[tracing::instrument(skip(self))]
|
|
pub fn public_rooms(&self) -> impl Iterator<Item = Result<Box<RoomId>>> + '_ {
|
|
self.db.public_rooms()
|
|
}
|
|
}
|