Skip to main content

rustolio_rpc/
lib.rs

1//
2// SPDX-License-Identifier: MPL-2.0
3//
4// Copyright (c) 2026 Tobias Binnewies. All rights reserved.
5//
6// This Source Code Form is subject to the terms of the Mozilla Public
7// License, v. 2.0. If a copy of the MPL was not distributed with this
8// file, You can obtain one at http://mozilla.org/MPL/2.0/.
9//
10
11mod error;
12
13#[cfg(not(target_arch = "wasm32"))]
14pub mod extractor;
15
16#[cfg(not(target_arch = "wasm32"))]
17pub mod middleware;
18
19#[cfg(not(target_arch = "wasm32"))]
20pub mod encode;
21
22#[cfg(target_arch = "wasm32")]
23pub mod web;
24
25use error::ServerFnError;
26
27#[cfg(not(target_arch = "wasm32"))]
28pub use extractor::Extract;
29
30pub mod prelude {
31    pub use crate::error::{IntoServerResult as _, ServerFnError};
32    pub use rustolio_rpc_macro::{extract, rpc};
33
34    #[doc(hidden)]
35    pub mod __rpc_macro {
36        #[cfg(target_arch = "wasm32")]
37        pub use crate::web::fetch_rpc_call;
38
39        #[cfg(not(target_arch = "wasm32"))]
40        pub use crate::Extract;
41        #[cfg(not(target_arch = "wasm32"))]
42        pub use crate::encode::{decode_rpc_body, encode_rpc_response};
43        #[cfg(not(target_arch = "wasm32"))]
44        pub use crate::middleware;
45        #[cfg(not(target_arch = "wasm32"))]
46        pub use inventory;
47        #[cfg(not(target_arch = "wasm32"))]
48        pub use rustolio_server_router;
49
50        pub use rustolio_utils::http;
51    }
52}