Expand description
East is an opinioned Rust full-stack web library for island architecture.
Re-exports§
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§
- Bounded
Scope - 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.
- Hydrate
Node - Rendering backend for the DOM with hydration support.
- Indexed
Props - Props for
Indexed. - Keyed
Props - 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. - Read
Signal - A read-only
Signal. - Scope
Disposer - A handle that allows cleaning up a
Scope. - Signal
- A container of reactive state that can be updated and subscribed to.
- Signal
Emitter - 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§
- AnyRead
Signal - A trait that is implemented for all
ReadSignals regardless of the type parameter. - Generic
Node - Abstraction over a rendering backend.
- Html
- Trait that is implemented by all
GenericNodebackends that render to HTML. - Render
- Render the current value into a static markup.
- Render
Dyn - Render a dynamic component.
- Render
Multi - Render the current value, along with children, into a static
markup. This is the same as
Renderbut 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
NodeRefon the currentScope. - create_
rc_ signal - Create a new
RcSignalwith the specified initial value. - create_
rc_ signal_ from_ rc - Create a new
RcSignalwith the specified initial value wrapped in aRc. - create_
reducer - An alternative to
create_signalthat 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 implementPartialEq. - 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
Signalunder the currentScope. The created signal lasts as long as the scope and cannot be used outside of the scope. - create_
signal_ from_ rc - Create a new
Signalunder the currentScopebut with an initial value wrapped in aRc. This is useful to avoid having to clone a value that is already wrapped in aRcwhen creating a new signal. Otherwise, this is identical tocreate_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
Vecto anotherVecvia a map function. The mappedVecis lazy computed, meaning that it’s value will only be updated when requested. Modifications to the inputVecare diffed by index to prevent recomputing values that have not changed. - map_
keyed - Function that maps a
Vecto anotherVecvia a map function. The mappedVecis lazy computed, meaning that it’s value will only be updated when requested. Modifications to the inputVecare 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 usinguse_contextlower in the scope hierarchy. - provide_
context_ ref - Provides a context in the current
Scope. The context can later be accessed by usinguse_contextlower in the scope hierarchy. - render_
to_ string - Render a
Viewinto a staticString. 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, seeuse_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
RcSignalthat istruewhen the scope is still valid andfalseonce it is disposed.
Type Aliases§
- Markup
- A pre-escaped owned string.
- Scope
- A type-alias for
BoundedScopewhere both lifetimes are the same.
Attribute Macros§
- component
- A macro for creating components from functions.
- render_
from_ dyn - Implement
RenderfromRenderDyn. - render_
from_ multi - Implement
RenderfromRenderMulti.