pub struct Homeserver {Show 16 fields
pub db: Db,
pub readers: OnceLock<ReadPool>,
pub live: LiveRegistry,
pub typing: TypingRegistry,
pub claim_rate: ClaimRateLimiter,
pub push: PushHub,
pub public_base_url: OnceLock<String>,
pub federation_delegate: OnceLock<String>,
pub federation_enabled: OnceLock<()>,
pub federation_allow: OnceLock<Vec<String>>,
pub anon_read: OnceLock<()>,
pub key_fetcher: OnceLock<Arc<dyn RemoteKeys>>,
pub fed_transport: OnceLock<Arc<dyn FedTransport>>,
pub fed_notify: Notify,
pub seam: OnceLock<Arc<Seam>>,
pub policy: OnceLock<Arc<dyn PolicyHook>>,
}Fields§
§db: DbThe store: one writer, bounded parallel readers (tesserax-store). Reach it through
Homeserver::conn_scope (blocking threads) or [with_conn_pub] (async).
readers: OnceLock<ReadPool>Parallel read-only connections (file-backed stores only; None for in-memory stores).
live: LiveRegistry§typing: TypingRegistry§claim_rate: ClaimRateLimiter§push: PushHub§public_base_url: OnceLock<String>Public client base URL for /.well-known/matrix/client (config, never hard-coded).
federation_delegate: OnceLock<String>m.server value for /.well-known/matrix/server; unset = federation off.
federation_enabled: OnceLock<()>Federation F0 switch: when set, the key and federation routes answer.
federation_allow: OnceLock<Vec<String>>Origins allowed to call federation routes; unset = any origin that proves its keys.
anon_read: OnceLock<()>Set (M4A_ANON_READ=on) to honour the product’s marked, assertion-less read-only forwards.
key_fetcher: OnceLock<Arc<dyn RemoteKeys>>How remote servers’ signing keys are fetched; unset = no remote verification.
fed_transport: OnceLock<Arc<dyn FedTransport>>Outgoing federation transport; unset = no outgoing federation.
fed_notify: NotifyWakes the outbox worker when new federation work exists.
seam: OnceLock<Arc<Seam>>Accounts, doors and issuer assertions; unset = legacy device-bearer behaviour only.
policy: OnceLock<Arc<dyn PolicyHook>>Policy hook; unset = allow everything.
Implementations§
Source§impl Homeserver
impl Homeserver
Sourcepub fn new(conn: Connection) -> Self
pub fn new(conn: Connection) -> Self
A store over an already-open in-memory connection (tests, the client’s local bus).
File-backed stores come from Homeserver::from_db.
Sourcepub fn check_policy(
&self,
caller: &Caller,
action: Action,
room_kind: Option<RoomKind>,
) -> Result<(), MatrixError>
pub fn check_policy( &self, caller: &Caller, action: Action, room_kind: Option<RoomKind>, ) -> Result<(), MatrixError>
Ask the policy hook (default: allow) about an action by caller.
Source§impl Homeserver
impl Homeserver
Sourcepub async fn conn_async<T: Send + 'static>(
&self,
f: impl FnOnce(&mut Connection) -> T + Send + 'static,
) -> T
pub async fn conn_async<T: Send + 'static>( &self, f: impl FnOnce(&mut Connection) -> T + Send + 'static, ) -> T
Runs f on the single writer connection, waiting for it. For blocking threads only
(spawn_blocking, plain threads); async code uses [with_conn_pub].
Async form of Homeserver::conn_scope (runs on the blocking pool).