Expand description
A series of imports needed by most Perseus apps, in some form. This should be used in conjunction with the Sycamore prelude.
Re-exports
pub use crate::error_views::ErrorViews;
pub use crate::errors::BlamedError;
pub use crate::errors::ErrorBlame;
pub use crate::reactor::Reactor;
pub use crate::state::BuildPaths;
pub use crate::state::RxResult;
pub use crate::state::RxResultRx;
pub use crate::state::SerdeInfallible;
pub use crate::state::StateGeneratorInfo;
pub use crate::template::Capsule;
pub use crate::template::Template;
pub use crate::utils::cache_fallible_res;
pub use crate::utils::cache_res;
pub use crate::PerseusNodeType;
pub use crate::Request;
pub use crate::utils::checkpoint;
Macros
- Logs the given
format!
-style data to the browser’s console, or to stdout on the server.
Structs
- The options for constructing a Perseus app. This
struct
will tie together all your code, declaring to Perseus where your templates, error pages, static content, etc. are.
Traits
- Trait that is implemented by all [
GenericNode
] backends that render to HTML.
Functions
- The component that represents the entrypoint at which Perseus will inject itself. You can use this with the
.index_view()
method ofPerseusAppBase
to avoid having to create the entrypoint<div>
manually. - Navigates to the specified
url
. The url should have the same origin as the app. - Navigates to the specified
url
without adding a new history entry. Instead, this replaces the current location with the newurl
. The url should have the same origin as the app. - Spawns a
!Send
future on the current scope. If the scope is destroyed before the future is completed, it is aborted immediately. This ensures that it is impossible to access any values referencing the scope after they are destroyed.
Type Definitions
- An alias for the usual kind of Perseus app, which uses the filesystem-based mutable store and translations manager. See
PerseusAppBase
for details. - An alias for a Perseus app that uses a custom mutable store type. See
PerseusAppBase
for details. - An alias for a fully customizable Perseus app that can accept a custom mutable store and a custom translations manager. Alternatively, you could just use
PerseusAppBase
directly. - An alias for a Perseus app that uses a custom translations manager type. See
PerseusAppBase
for details.
Attribute Macros
- A helper macro for templates that use reactive state. Once, this was needed on all Perseus templates, however, today, templates that take no state, or templates that take unreactive state, can be provided as normal functions to the methods
.view()
and.view_with_unreactive_state()
respectively, on Perseus’Template
type. - Marks the given function as the browser entrypoint into your app. This is designed for more complex apps that need to manually distinguish between the engine and browser entrypoints.
- A convenience macro that makes sure the given function is only defined on the browser-side, creating an empty function on the engine-side. Perseus implicitly expects your browser-side state modification functions to be defined in this way (though you certainly don’t have to use this macro).
- Marks the given function as the engine entrypoint into your app. This is designed for more complex apps that need to manually distinguish between the engine and browser entrypoints.
- A convenience macro that makes sure the given function is only defined on the engine-side, creating an empty function on the browser-side. Perseus implicitly expects most of your state generation functions to be defined in this way (though you certainly don’t have to use this macro).
- Marks the given function as the universal entrypoint into your app. This is designed for simple use-cases, and the annotated function should return a
PerseusApp
. This will expand into separatemain()
functions for both the browser and engine sides. - This is identical to
#[main]
, except it doesn’t require a server integration, because it sets your app up for exporting only. This is useful for apps not using server-requiring features (like incremental static generation and revalidation) that want to avoid bringing in another dependency on the server-side. - Marks the given function as a Perseus test. Functions marked with this attribute must have the following signature:
async fn foo(client: &mut fantoccini::Client) -> Result<>
.
Derive Macros
- Processes the given
struct
to create a reactive version by wrapping each field in aSignal
. This will generate a newstruct
with the given name and implement a.make_rx()
method on the original that allows turning an instance of the unreactivestruct
into an instance of the reactive one.