Skip to main content

euv_core/
lib.rs

1//! euv-core
2//!
3//! A declarative, cross-platform UI framework for Rust with virtual DOM,
4//! reactive signals, and HTML macros for WebAssembly.
5
6mod app;
7mod event;
8#[cfg(target_arch = "wasm32")]
9mod fetch;
10mod noderef;
11mod reactive;
12mod renderer;
13mod vdom;
14
15#[cfg(test)]
16#[path = "../tests/mod.rs"]
17mod tests;
18
19pub use {app::*, event::*, noderef::*, reactive::*, vdom::*};
20
21#[cfg(target_arch = "wasm32")]
22pub use fetch::*;
23
24pub use std::{
25    borrow::Cow,
26    collections::hash_map::DefaultHasher,
27    collections::{HashMap, HashSet, VecDeque},
28    fmt::{self, Debug, Display, Formatter},
29    hash::{Hash, Hasher},
30    iter::Iterator,
31    marker::PhantomData,
32    mem::{swap, take, zeroed},
33    ops::Deref,
34    panic::{AssertUnwindSafe, catch_unwind},
35    sync::{LazyLock, OnceLock, RwLock, RwLockReadGuard},
36    thread::LocalKey,
37};
38
39pub use {js_sys::*, lombok_macros::*, wasm_bindgen::prelude::*, web_sys::*};
40
41pub(crate) use bin_encode_decode::{Charset, EncodeError};
42
43/// The wall clock [`now_micros`] reads on a host build. On wasm the clock
44/// comes from JS instead, so importing this there is an `unused_imports`
45/// warning — the mirror of the dead-const warning the host build would give
46/// the other half of the same function.
47#[cfg(not(target_arch = "wasm32"))]
48pub(crate) use std::time::{SystemTime, UNIX_EPOCH};
49
50pub(crate) use renderer::*;
51
52use std::{
53    any::Any,
54    cell::{Cell, Ref, RefCell, RefMut, UnsafeCell},
55    num::ParseIntError,
56    rc::Rc,
57    str::from_utf8,
58    sync::{
59        PoisonError, RwLockWriteGuard,
60        atomic::{AtomicBool, AtomicUsize, Ordering},
61    },
62    thread::AccessError,
63    vec::Vec,
64};