Crate east

Crate east 

Source
Expand description

East is an opinioned Rust full-stack web library for island architecture.

Re-exports§

pub use serde;
pub use sycamore;

Modules§

builder
The builder pattern API for creating UI elements.

Macros§

node
Like view! but only creates a single raw node instead.
render
Render a static markup without any dynamic component.
render_dyn
Render a dynamic component.
render_with_component
Render a static markup with given dynamic component type.
view
A macro for ergonomically creating complex UI structures.

Structs§

BoundedScope
A reference to a reactive scope. This reference is Copy, allowing it to be copied into closures without any clones.
Children
A special property type to allow the component to accept children.
DomNode
Rendering backend for the DOM.
HydrateNode
Rendering backend for the DOM with hydration support.
IndexedProps
Props for Indexed.
KeyedProps
Props for Keyed.
Modify
A mutable reference for modifying a Signal.
NodeRef
A reference to a GenericNode. This allows imperatively accessing the node.
PreEscaped
A pre-escaped string.
RcSignal
A signal that is not bound to a Scope.
ReadSignal
A read-only Signal.
ScopeDisposer
A handle that allows cleaning up a Scope.
Signal
A container of reactive state that can be updated and subscribed to.
SignalEmitter
A struct for managing subscriptions to signals.
SsrNode
Rendering backend for Server Side Rendering, aka. SSR.
View
Represents an UI view. Usually constructed using the view! macro or using the builder API.

Enums§

NoComponent
Representing a renderer without any dynamic component.

Traits§

AnyReadSignal
A trait that is implemented for all ReadSignals regardless of the type parameter.
GenericNode
Abstraction over a rendering backend.
Html
Trait that is implemented by all GenericNode backends that render to HTML.
Render
Render the current value into a static markup.
RenderDyn
Render a dynamic component.
RenderMulti
Render the current value, along with children, into a static markup. This is the same as Render but with children.

Functions§

Indexed
Non keyed iteration (or keyed by index). Use this instead of directly rendering an array of Views. Using this will minimize re-renders instead of re-rendering every single node on every state change.
Keyed
Keyed iteration. Use this instead of directly rendering an array of Views. Using this will minimize re-renders instead of re-rendering every view node on every state change.
create_child_scope
Create a child scope.
create_effect
Creates an effect on signals used inside the effect closure.
create_effect_scoped
Creates an effect on signals used inside the effect closure.
create_memo
Creates a memoized computation from some signals. The output is derived from all the signals that are used within the memo closure. If any of the tracked signals are updated, the memo is also updated.
create_node_ref
Create a new NodeRef on the current Scope.
create_rc_signal
Create a new RcSignal with the specified initial value.
create_rc_signal_from_rc
Create a new RcSignal with the specified initial value wrapped in a Rc.
create_reducer
An alternative to create_signal that uses a reducer to get the next value.
create_ref
Allocate a new arbitrary value under the current Scope. The allocated value lasts as long as the scope and cannot be used outside of the scope.
create_scope
Creates a reactive scope.
create_scope_immediate
Creates a reactive scope, runs the callback, and disposes the scope immediately.
create_selector
Creates a memoized value from some signals. Unlike create_memo, this function will not notify dependents of a change if the output is the same. That is why the output of the function must implement PartialEq.
create_selector_with
Creates a memoized value from some signals. Unlike create_memo, this function will not notify dependents of a change if the output is the same.
create_signal
Create a new Signal under the current Scope. The created signal lasts as long as the scope and cannot be used outside of the scope.
create_signal_from_rc
Create a new Signal under the current Scope but with an initial value wrapped in a Rc. This is useful to avoid having to clone a value that is already wrapped in a Rc when creating a new signal. Otherwise, this is identical to create_signal.
escape
Escape HTML string.
escape_to_string
Escape HTML string to output.
json_to_string
Serialize the given data structure as a String of JSON.
map_indexed
Function that maps a Vec to another Vec via a map function. The mapped Vec is lazy computed, meaning that it’s value will only be updated when requested. Modifications to the input Vec are diffed by index to prevent recomputing values that have not changed.
map_keyed
Function that maps a Vec to another Vec via a map function. The mapped Vec is lazy computed, meaning that it’s value will only be updated when requested. Modifications to the input Vec are diffed using keys to prevent recomputing values that have not changed.
on
A helper function for making it explicit to define dependencies for an effect.
on_cleanup
Adds a callback that is called when the scope is destroyed.
on_mount
Queue up a callback to be executed when the component is mounted.
provide_context
Provides a context in the current Scope. The context can later be accessed by using use_context lower in the scope hierarchy.
provide_context_ref
Provides a context in the current Scope. The context can later be accessed by using use_context lower in the scope hierarchy.
render_to_string
Render a View into a static String. Useful for rendering to a string on the server side.
scope_depth
Returns the current depth of the scope. If the scope is the root scope, returns 0.
try_use_context
Tries to get a context value of the given type. If no context with the right type found, returns None. For a panicking version, see use_context.
untrack
Run the passed closure inside an untracked dependency scope.
use_context
Gets a context value of the given type.
use_context_or_else
Gets a context value of the given type or computes it from a closure.
use_context_or_else_ref
Gets a context value of the given type or computes it from a closure.
use_scope_status
Returns a RcSignal that is true when the scope is still valid and false once it is disposed.

Type Aliases§

Markup
A pre-escaped owned string.
Scope
A type-alias for BoundedScope where both lifetimes are the same.

Attribute Macros§

component
A macro for creating components from functions.
render_from_dyn
Implement Render from RenderDyn.
render_from_multi
Implement Render from RenderMulti.

Derive Macros§

Prop
The derive macro for Prop. The macro creates a builder-like API used in the view! macro.