Crate perspective
source · [−]Modules
A collection of (de-)serializable structs which capture the application
state, suitable for persistence, history, etc. features.
A catch all for project-wide macros and general-purpose functions that are
not directly related to Perspective. Modules below
crate::utils
strive
to be single-responsibility, but some reference other crate::utils
modules when it helps reduce boiler-plate.Macros
A helper to for the pattern
let x2 = x;
necessary to clone structs
destined for an async
or 'static
closure stack. This is like move || { .. }
or move async { .. }
, but for clone semantics. clone!()
works
with symbols as well as properties and methods, using the last symbol name
in the method chain, or an alias via x = ...
syntax.A macro for implementing the
wasm_bindgen
boilerplate for types which
implement serde::{Serialize, Deserialize}
.A macro which set a property called
weak_link
on the container
Properties
when cfg(test)
, such that unit tests may send messages to a
component. This macro needs to be called in create()
on any Component
which needs to receive messages in a test.A macro which derives a
yew::Component
for an arbitrary HTML snippet and
mounts it, for testing.Functions
Register Web Components with the global registry, given a Perspective
module. This function shouldn’t be called directly; instead, use the
define_web_components!
macro to both call this method and hook the
wasm_bindgen module object.Export all ExprTK commands, for use in generating documentation.
Register this crate’s Custom Elements in the browser’s current session.
This must occur before calling any public API methods on these Custom
Elements from JavaScript, as the methods themselves won’t be defined yet.
By default, this crate does not register
PerspectiveViewerElement
(as to
preserve backwards-compatible synchronous API).Register a plugin globally.