Skip to main content

mobius_gateway/
lib.rs

1//! Authenticated, frontend-neutral access to independent möbius chats.
2
3mod assembly;
4pub mod auth;
5pub mod bots;
6pub mod client;
7mod cloudflare;
8pub mod command;
9pub mod config;
10mod extensions;
11mod host;
12mod middleware_manifest;
13mod provider_catalog;
14mod publication;
15pub mod sandbox;
16pub mod server;
17pub mod wire;
18
19/// Errors returned by the gateway library.
20#[derive(Debug, thiserror::Error)]
21pub enum Error {
22    #[error("gateway configuration error: {0}")]
23    Config(String),
24    #[error("gateway protocol error: {0}")]
25    Protocol(String),
26    #[error("gateway authentication failed")]
27    Unauthorized,
28    #[error(transparent)]
29    Mobius(#[from] mobius::Error),
30    #[error(transparent)]
31    Io(#[from] std::io::Error),
32    #[error(transparent)]
33    Json(#[from] serde_json::Error),
34    #[error("Bot storage error")]
35    Sqlite(#[from] rusqlite::Error),
36}
37
38/// Result type shared by gateway modules.
39pub type Result<T> = std::result::Result<T, Error>;