1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-07-28 10:48:30 +00:00
continuwuity/src/lib.rs

24 lines
788 B
Rust
Raw Normal View History

2022-10-05 20:34:31 +02:00
pub mod api;
2022-02-03 13:30:04 +01:00
mod config;
mod database;
mod service;
mod utils;
// Not async due to services() being used in many closures, and async closures
// are not stable as of writing This is the case for every other occurence of
// sync Mutex/RwLock, except for database related ones, where the current
// maintainer (Timo) has asked to not modify those
2022-10-08 13:03:07 +02:00
use std::sync::RwLock;
2022-10-05 20:34:31 +02:00
pub use api::ruma_wrapper::{Ruma, RumaResponse};
2022-02-03 13:30:04 +01:00
pub use config::Config;
2022-10-08 13:03:07 +02:00
pub use database::KeyValueDatabase;
2022-10-05 20:34:31 +02:00
pub use service::{pdu::PduEvent, Services};
pub use utils::error::{Error, Result};
pub static SERVICES: RwLock<Option<&'static Services<'static>>> = RwLock::new(None);
pub fn services() -> &'static Services<'static> {
SERVICES.read().unwrap().expect("SERVICES should be initialized when this is called")
}