[][src]Module seed::browser::util

Provide a wrapper for commonly-used, but verbose web_sys features. This module is decoupled / independent.

Structs

RequestAnimationFrameHandle

Traits

ClosureNew

Prevent repetition when wrapping closures.

Functions

body

Convenience function to access the web_sys DOM body.

canvas

Convenience function to access the web_sys::HtmlCanvasElement. /// Note: Returns None if there is no element with the given id or the element isn't HtmlCanvasElement.

canvas_context_2d

Convenience function to access the web_sys::CanvasRenderingContext2d.

cookies

Convenience function to get all cookies from the current HtmlDocument Note: Returns None if parsing cookies fails or there are no cookies.

document

Convenience function to access the web_sys DOM document.

error

Similar to log, but for errors.

get_checked

Similar to get_value

get_value

Simplify getting the value of input elements; required due to the need to cast from general nodes/elements to HTML_Elements.

history

Convenience function to access the web_sys history.

html_document

Convenience function to access the web_sys::HtmlDocument.

log

Convenience function for logging to the web browser's console. See also the log! macro, which is more flexible.

request_animation_frame

Request the animation frame.

set_checked

Similar to set_value.

set_value

Similar to get_value.

window

Convenience function to avoid repeating expect logic.

Type Definitions

RequestAnimationFrameTime