2021-10-13 10:24:39 +02:00
|
|
|
#![warn(
|
|
|
|
rust_2018_idioms,
|
|
|
|
unused_qualifications,
|
|
|
|
clippy::cloned_instead_of_copied,
|
|
|
|
clippy::str_to_string
|
|
|
|
)]
|
2021-03-04 15:26:34 +01:00
|
|
|
#![allow(clippy::suspicious_else_formatting)]
|
2021-05-05 18:14:49 +02:00
|
|
|
#![deny(clippy::dbg_macro)]
|
|
|
|
|
2022-10-05 20:34:31 +02:00
|
|
|
pub mod api;
|
2022-02-03 13:30:04 +01:00
|
|
|
mod config;
|
2020-07-26 05:08:00 +02:00
|
|
|
mod database;
|
2022-09-06 23:15:09 +02:00
|
|
|
mod service;
|
2020-07-26 05:08:00 +02:00
|
|
|
mod utils;
|
|
|
|
|
2022-10-08 13:03:07 +02:00
|
|
|
use std::sync::RwLock;
|
2022-01-18 21:04:44 +01:00
|
|
|
|
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};
|
2022-09-06 23:15:09 +02:00
|
|
|
pub use utils::error::{Error, Result};
|
|
|
|
|
2022-10-05 15:33:57 +02:00
|
|
|
pub static SERVICES: RwLock<Option<&'static Services>> = RwLock::new(None);
|
2022-09-06 23:15:09 +02:00
|
|
|
|
2022-10-05 15:33:57 +02:00
|
|
|
pub fn services<'a>() -> &'static Services {
|
2022-10-05 20:34:31 +02:00
|
|
|
&SERVICES
|
|
|
|
.read()
|
|
|
|
.unwrap()
|
|
|
|
.expect("SERVICES should be initialized when this is called")
|
2022-09-06 23:15:09 +02:00
|
|
|
}
|