Module medea_jason::utils[][src]

Miscellaneous utility structs and functions.

Modules

component

Implementation of the Component.

Structs

Callback0

Wrapper for JS function with no arguments.

Callback1

Wrapper for a single argument JS function.

Callback2

Wrapper for a JS functions with two arguments.

Component

Component is a base that helps managing reactive components.

EventListener

Wrapper for closure that handles some EventTarget event.

EventListenerBindError

Failed to bind to EventTarget event.

HandlerDetachedError

Occurs if referenced value was dropped.

IntervalHandle

Wrapper around interval timer ID.

JasonError

Representation of app error exported to JS side.

JsDuration

Wrapper around Duration which can be transformed into i32 for JS side timers.

JsError

Wrapper for JS value which returned from JS side as error.

JsonParseError

Wrapper for serde_json::error::Error that provides Clone, Debug, Display implementations.

ResettableDelayHandle

Handler to delay which can be stopped and started over again Duration.

TaskHandle

Wrapper around [AbortHandle] which aborts Future on Drop.

Traits

AsProtoState

Abstraction over a state which can be transformed to the states from the medea_client_api_proto::state.

JsCaused

Representation of an error which can caused by error returned from the JS side.

SynchronizableState

Abstraction of state which can be updated or created by the medea_client_api_proto::state.

Updatable

Abstraction over a state which can be updated by a client side.

Functions

console_error

Prints provided message with Console.error().

delay_for

Future which resolves after the provided JsDuration.

get_property_by_name

Returns property of JS object by name if its defined. Converts the value with a given predicate.

resettable_delay_for

Returns Future that will be resolved after provided Duration and ResettableDelayHandle that allows you to control delay future.

transpose_guarded

Returns Future which will return the provided value being Guarded::transpose()d.

window

Returns Window object.

Derive Macros

JsCaused

Generate implementation of JsCaused trait for errors represented as enum.