dioxus_core/
lib.rs

1#![doc = include_str!("../README.md")]
2#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
3#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
4#![warn(missing_docs)]
5
6mod any_props;
7mod arena;
8mod diff;
9mod effect;
10mod error_boundary;
11mod events;
12mod fragment;
13mod generational_box;
14mod global_context;
15mod launch;
16mod mutations;
17mod nodes;
18mod properties;
19mod reactive_context;
20mod render_error;
21mod root_wrapper;
22mod runtime;
23mod scheduler;
24mod scope_arena;
25mod scope_context;
26mod scopes;
27mod suspense;
28mod tasks;
29mod virtual_dom;
30
31mod hotreload_utils;
32
33/// Items exported from this module are used in macros and should not be used directly.
34#[doc(hidden)]
35pub mod internal {
36    #[doc(hidden)]
37    pub use crate::hotreload_utils::{
38        DynamicLiteralPool, DynamicValuePool, FmtSegment, FmtedSegments, HotReloadAttributeValue,
39        HotReloadDynamicAttribute, HotReloadDynamicNode, HotReloadLiteral,
40        HotReloadTemplateWithLocation, HotReloadedTemplate, HotreloadedLiteral, NamedAttribute,
41        TemplateGlobalKey,
42    };
43
44    #[doc(hidden)]
45    pub use generational_box;
46}
47
48pub(crate) mod innerlude {
49    pub(crate) use crate::any_props::*;
50    pub use crate::arena::*;
51    pub(crate) use crate::effect::*;
52    pub use crate::error_boundary::*;
53    pub use crate::events::*;
54    pub use crate::fragment::*;
55    pub use crate::generational_box::*;
56    pub use crate::global_context::*;
57    pub use crate::launch::*;
58    pub use crate::mutations::*;
59    pub use crate::nodes::*;
60    pub use crate::properties::*;
61    pub use crate::reactive_context::*;
62    pub use crate::render_error::*;
63    pub use crate::runtime::{Runtime, RuntimeGuard};
64    pub use crate::scheduler::*;
65    pub use crate::scopes::*;
66    pub use crate::suspense::*;
67    pub use crate::tasks::*;
68    pub use crate::virtual_dom::*;
69
70    /// An [`Element`] is a possibly-none [`VNode`] created by calling `render` on [`ScopeId`] or [`ScopeState`].
71    ///
72    /// An Errored [`Element`] will propagate the error to the nearest error boundary.
73    pub type Element = std::result::Result<VNode, RenderError>;
74
75    /// A [`Component`] is a function that takes [`Properties`] and returns an [`Element`].
76    pub type Component<P = ()> = fn(P) -> Element;
77}
78
79pub use crate::innerlude::{
80    consume_context, consume_context_from_scope, current_owner, current_scope_id, fc_to_builder,
81    force_all_dirty, generation, has_context, needs_update, needs_update_any, parent_scope,
82    provide_context, provide_error_boundary, provide_root_context, queue_effect, remove_future,
83    schedule_update, schedule_update_any, spawn, spawn_forever, spawn_isomorphic, suspend,
84    suspense_context, throw_error, try_consume_context, use_after_render, use_before_render,
85    use_drop, use_hook, use_hook_with_cleanup, vdom_is_rendering, with_owner, AnyValue, Attribute,
86    AttributeValue, Callback, CapturedError, Component, ComponentFunction, Context, DynamicNode,
87    Element, ElementId, ErrorBoundary, ErrorContext, Event, EventHandler, Fragment, HasAttributes,
88    IntoAttributeValue, IntoDynNode, LaunchConfig, ListenerCallback, MarkerWrapper, Mutation,
89    Mutations, NoOpMutations, Ok, OptionStringFromMarker, Properties, ReactiveContext, RenderError,
90    Result, Runtime, RuntimeGuard, ScopeId, ScopeState, SpawnIfAsync, SubscriberList, Subscribers,
91    SuperFrom, SuperInto, SuspendedFuture, SuspenseBoundary, SuspenseBoundaryProps,
92    SuspenseContext, SuspenseExtension, Task, Template, TemplateAttribute, TemplateNode,
93    VComponent, VNode, VNodeInner, VPlaceholder, VText, VirtualDom, WriteMutations,
94};
95
96pub use const_format;