MCPcopy Create free account
hub / github.com/PerroEngine/Perro / document

Function document

perro_source/api_modules/perro_web/src/storage.rs:136–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135#[cfg(target_arch = "wasm32")]
136fn document() -> io::Result<web_sys::HtmlDocument> {
137 use wasm_bindgen::JsCast;
138
139 let window = web_sys::window()
140 .ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "window !found"))?;
141 window
142 .document()
143 .ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "document !found"))?
144 .dyn_into::<web_sys::HtmlDocument>()
145 .map_err(|_| io::Error::other("html document cast fail"))
146}
147
148#[cfg(target_arch = "wasm32")]
149fn cookie_encode(text: &str) -> String {

Callers 3

load_cookie_valueFunction · 0.85
save_cookie_valueFunction · 0.85
remove_cookie_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected