Skip to main content

rustolio_web/
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 elements;
12mod error;
13mod renderer;
14mod router;
15
16pub mod hooks;
17
18pub use renderer::{BrowserRenderer, ServerRenderer};
19
20pub use router::{Router, Routes};
21pub use rustolio_web_router_macro::Routes;
22
23pub use rustolio_utils::{Error, Result};
24
25pub mod prelude {
26    pub use rustolio_utils::prelude::*;
27    pub use rustolio_utils::web_sys::prelude::*;
28
29    // elements
30    pub use crate::elements::html::traits::*;
31    pub use crate::elements::html_tags::*;
32    pub use crate::elements::{
33        Element, Elements, IntoElementClosureWrapper as _, IntoElementIteratorWrapper as _,
34        IntoElementWrapper as _, IntoElementsIteratorWrapper as _, IntoElementsWrapper as _,
35        IntoStringWrapper as _, RcElementSliceWrapper as _, RcElementsSliceWrapper as _,
36    };
37
38    pub use crate::elements::html;
39    pub use crate::elements::html::ListenerExt as _;
40
41    // hooks
42    pub use crate::hooks::{
43        Calculated, Context, Effect, GlobalSignal, GlobalWrapper, QuerySignal, Signal,
44        SignalGetter, SignalSetter, SignalToggle, SignalUpdater, StorageSignal, global, spawn,
45        spawn_result, timeout,
46    };
47
48    pub use crate::error::ErrorExt as _;
49
50    pub use crate::router::Routes as _;
51
52    pub use rustolio_utils::concat_classes;
53
54    #[doc(hidden)]
55    pub mod __web_global_macro {
56        pub use inventory;
57        pub use typed_builder;
58    }
59
60    #[doc(hidden)]
61    pub mod __web_router_macro {
62        pub use crate::router::Routes;
63        pub use matchit;
64    }
65}