rustolio-rpc 0.1.0

An RPC extention for the HTTP-Server
Documentation
//
// SPDX-License-Identifier: MPL-2.0
//
// Copyright (c) 2026 Tobias Binnewies. All rights reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//

mod error;

#[cfg(not(target_arch = "wasm32"))]
pub mod extractor;

#[cfg(not(target_arch = "wasm32"))]
pub mod middleware;

#[cfg(not(target_arch = "wasm32"))]
pub mod encode;

#[cfg(target_arch = "wasm32")]
pub mod web;

use error::ServerFnError;

#[cfg(not(target_arch = "wasm32"))]
pub use extractor::Extract;

pub mod prelude {
    pub use crate::error::{IntoServerResult as _, ServerFnError};
    pub use rustolio_rpc_macro::{extract, rpc};

    #[doc(hidden)]
    pub mod __rpc_macro {
        #[cfg(target_arch = "wasm32")]
        pub use crate::web::fetch_rpc_call;

        #[cfg(not(target_arch = "wasm32"))]
        pub use crate::Extract;
        #[cfg(not(target_arch = "wasm32"))]
        pub use crate::encode::{decode_rpc_body, encode_rpc_response};
        #[cfg(not(target_arch = "wasm32"))]
        pub use crate::middleware;
        #[cfg(not(target_arch = "wasm32"))]
        pub use inventory;
        #[cfg(not(target_arch = "wasm32"))]
        pub use rustolio_server_router;

        pub use rustolio_utils::http;
    }
}