Expand description
Sauron is an web framework for creating fast and interactive client side web application, as well as server-side rendering for back-end web applications.
Re-exports
pub use sauron_core::jss as jss_crate;
Modules
- This module provides functionalities for manipulating the actual Document Object Model in the browser
- Provides functions and macros to build html elements
- Bindings to JavaScript’s standard, built-in objects, including their methods and properties.
- Provides convenient functions and macro to build dynamic css
- mt-dom is a generic virtual dom implementation which doesn’t specify the types of the data that is being processed. It’s up to the library user to specify those types
- Provides functions and macros to build svg elements
- vdom stands for virtual-dom. This module contains types that are derived from mt-dom where we assign concrete types into the generics.
- Runtime support for the
wasm-bindgen
tool - Converting between JavaScript
Promise
s to RustFuture
s. - Raw API bindings for Web APIs
Macros
- declare a function with the name corresponds to attribute name for easy usage in html elements Example:
- Creates css using json notation
- Create a css string using json notation and use namespace on the class selectors
- create css using jss with namespace macro with correct indentions
- Create css using jss macro with nice indentions
- creates a key attribute using a formatter
- Quasi-quoting macro for building sauron Nodes.
- Creat a style attribute
- creates a text node using a formatter
Structs
- A handle to both a closure in Rust as well as JS closure which will invoke the Rust closure.
- Effects is a convenient way to group Msg for component to execute subsequent updates based on certain conditions. This can be used for doing animation and incremental changes to the view to provide an effect of transition or animation.
- Convenience type for use on exported
fn() -> Result<T, JsError>
functions, where you wish to throw a JavaScriptError
object. - Representation of an object owned by JS.
- Program handle the lifecycle of the APP
Traits
- An Application is the root component of your program. Everything that happens in your application is done here.
- Add mapping function for Attribute
- A component has a view and can update itself.
- A Container have children that is set from the parent component
- a trait for implementing CustomElement in the DOM with custom tag
- This trait is used in the DomUpdater to call the dispatch method when an event occured
- Add mapping function for Element
- A trait for checked and unchecked casting between JS types.
- Add mapping function for Node, Element, Attribute,
- render node, elements to a writable buffer
- An extension trait for
Option<T>
andResult<T, E>
for unwrapping theT
value, or throwing a JS error if it is not available.
Functions
- Creates an html a element
- Creates an html abbr element
- Creates an html address element
- Creates an svg animate element
- Creates an svg animateMotion element
- Creates an svg animateTransform element
- Creates an html article element
- Creates an html aside element
- Creates an html audio element
- Creates an html b element
- Creates an html bdi element
- Creates an html bdo element
- Creates an html blockquote element
- Creates an html body element
- Creates an html button element
- Creates an html canvas element
- Creates an html caption element
- Relative to the width of the “0” (zero)
- Creates an svg circle element
- Creates an html cite element
- Creates an svg clipPath element
- Creates an html code element
- Creates an html colgroup element
- Creates an html datalist element
- Creates an html dd element
- Creates an svg defs element
- Creates an html del element
- Creates an svg desc element
- Creates an html details element
- Creates an html dfn element
- Creates an html dialog element
- This is a sauron html specific functionality diff 2 nodes with attribute using
&'static str
instead of generic ATT - Creates an svg discard element
- Creates an html div element
- Creates an html dl element
- provides access to the document element
- Creates an html dt element
- Creates an svg ellipse element
- Relative to the font-size of the element (2em means 2 times the size of the current font)
- Creates an svg feBlend element
- Creates an svg feColorMatrix element
- Creates an svg feComponentTransfer element
- Creates an svg feComposite element
- Creates an svg feConvolveMatrix element
- Creates an svg feDiffuseLighting element
- Creates an svg feDisplacementMap element
- Creates an svg feDistantLight element
- Creates an svg feDropShadow element
- Creates an svg feFlood element
- Creates an svg feFuncA element
- Creates an svg feFuncB element
- Creates an svg feFuncG element
- Creates an svg feFuncR element
- Creates an svg feGaussianBlur element
- Creates an svg feImage element
- Creates an svg feMerge element
- Creates an svg feMergeNode element
- Creates an svg feMorphology element
- Creates an svg feOffset element
- Creates an svg fePointLight element
- Creates an svg feSpecularLighting element
- Creates an svg feSpotLight element
- Creates an svg feTile element
- Creates an svg feTurbulence element
- Creates an html fieldset element
- Creates an html figcaption element
- Creates an html figure element
- Creates an svg filter element
- Creates an html footer element
- Creates an svg foreignObject element
- Creates an html form element
- Creates an svg g element
- Creates an html h1 element
- Creates an html h2 element
- Creates an html h3 element
- Creates an html h4 element
- Creates an html h5 element
- Creates an html h6 element
- Creates an svg hatch element
- Creates an svg hatchpath element
- Creates an html head element
- Creates an html header element
- Creates an html hgroup element
- Creates an html html element
- Creates an html i element
- Creates an html iframe element
- Creates an svg image element
- Creates an html ins element
- Creates an html kbd element
- Creates an html label element
- Creates an html legend element
- Creates an html li element
- Creates an svg line element
- Creates an svg linearGradient element
- Creates an html main element
- Creates an html map element
- Creates an html mark element
- Creates an svg marker element
- Creates an svg mask element
- Creates an html menu element
- Creates an html menuitem element
- Creates an svg mesh element
- Creates an svg meshgradient element
- Creates an svg meshpatch element
- Creates an svg meshrow element
- Creates an svg metadata element
- Creates an html meter element
- Creates an svg mpath element
- Creates an html nav element
- Creates an html noscript element
- return the instantaneous time
- Creates an html object element
- Creates an html ol element
- Creates an html optgroup element
- Creates an html option element
- Creates an html output element
- Creates an html p element
- Creates an svg path element
- Creates an svg pattern element
- percentage Example:
- Creates an html picture element
- Creates an svg polygon element
- Creates an svg polyline element
- Creates an html pre element
- Creates an html progress element
- points (1pt = 1/72 of 1in)
- pixels (1px = 1/96th of 1in)
- Creates an html q element
- Creates an svg radialGradient element
- Creates an html rb element
- Creates an svg rect element
- Relative to font-size of the root element
- Creates an html rp element
- Creates an html rt element
- Creates an html rtc element
- Creates an html ruby element
- Creates an html s element
- Creates an html samp element
- Creates an html script element
- Creates an html section element
- Creates an html select element
- Creates an svg set element
- Creates an html small element
- Creates an svg solidcolor element
- Creates an html span element
- Creates an svg stop element
- Creates an html strong element
- Creates an html sub element
- Creates an html summary element
- Creates an html sup element
- Creates an svg svg element
- Creates an svg switch element
- Creates an svg symbol element
- Creates an html table element
- Creates an html tbody element
- Creates an html td element
- Creates an html template element
- Creates an svg textPath element
- Creates an html textarea element
- Creates an html tfoot element
- Creates an html th element
- Creates an html thead element
- Creates an html time element
- Creates an html tr element
- Creates an svg tspan element
- Creates an html u element
- Creates an html ul element
- Creates an svg unknown element
- Creates an html var element
- Creates an html video element
- Creates an svg view element
- utility function which returns the Window element
Type Definitions
- Attribute type used in sauron where the type of the Attribute name is &’static str
- alias Cmd to use Program as the APP
- Element type with tag and attribute name type set to &’static str
- Callback where Event type is supplied for Components
- A simplified version of saurdon_vdom node, where we supplied the type for the tag which is a &’static str. The missing type is now only MSG which will be supplied by the users App code.
- Patch as result of diffing the current_vdom and the new vdom. The tag and attribute name types is set to &’static str