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