div 0.2.0

Crate to ease web-programming including Rust as fist-class citizen.
Documentation
1
2
3
4
5
6
use crate::DivError;

pub(crate) fn doc() -> Result<web_sys::Document, DivError> {
    let window = web_sys::window().ok_or(DivError::MissingWindow)?;
    window.document().ok_or(DivError::MissingDocument)
}