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;
6mod channel;
7pub mod client;
8mod cloudflare;
9pub mod command;
10mod computer_runtime;
11pub mod config;
12mod extensions;
13/// Shared saved gateway accounts and endpoint selection.
14pub mod gateway_accounts;
15mod host;
16mod middleware_manifest;
17mod persistent_chat;
18mod provider_catalog;
19mod publication;
20pub mod sandbox;
21pub mod server;
22pub mod wire;
23
24pub use extensions::MAX_EXTENSION_SOURCE_BYTES;
25
26/// Errors returned by the gateway library.
27#[derive(Debug, thiserror::Error)]
28pub enum Error {
29    #[error("gateway configuration error: {0}")]
30    /// Selects the config case.
31    Config(String),
32    #[error("gateway protocol error: {0}")]
33    /// Selects the protocol case.
34    Protocol(String),
35    #[error("gateway authentication failed")]
36    /// Selects the unauthorized case.
37    Unauthorized,
38    #[error(transparent)]
39    /// Selects the mobius case.
40    Mobius(#[from] mobius::Error),
41    #[error(transparent)]
42    /// Selects the I/O case.
43    Io(#[from] std::io::Error),
44    #[error(transparent)]
45    /// Selects the JSON case.
46    Json(#[from] serde_json::Error),
47    #[error("Bot storage error")]
48    /// Selects the SQLite case.
49    Sqlite(#[from] rusqlite::Error),
50}
51
52/// Result type shared by gateway modules.
53pub type Result<T> = std::result::Result<T, Error>;