pub struct Folds { /* private fields */ }Expand description
A component’s compiled handlers.
Implementations§
Source§impl Folds
impl Folds
Sourcepub fn compile(
source: &str,
uses: &[String],
host: Rc<dyn Host>,
) -> Result<Self, FoldError>
pub fn compile( source: &str, uses: &[String], host: Rc<dyn Host>, ) -> Result<Self, FoldError>
Compiles source for a component whose uses is uses; refused
when it does not compile, when a fn is not a fold, or when a
handler calls a method outside uses — or by a name computed at run
time — naming it.
Sourcepub fn run(
&self,
handler: &str,
state: &Map<String, Value>,
event: &Value,
props: &Map<String, Value>,
live: &Map<String, Value>,
) -> Result<Map<String, Value>, FoldError>
pub fn run( &self, handler: &str, state: &Map<String, Value>, event: &Value, props: &Map<String, Value>, live: &Map<String, Value>, ) -> Result<Map<String, Value>, FoldError>
Runs handler on state and the event: ev is the DOM event’s
payload (value, checked, target, key, the scroll metrics) with the props as ev.props and each
live collection’s rows as ev.live.<name>. The new state.
Auto Trait Implementations§
impl !Freeze for Folds
impl !RefUnwindSafe for Folds
impl !Send for Folds
impl !Sync for Folds
impl !UnwindSafe for Folds
impl Forget for Folds
impl Move for Folds
impl Unpin for Folds
impl UnsafeUnpin for Folds
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more