MCPcopy Create free account
hub / github.com/endbasic/endbasic / from_window

Method from_window

web/src/store.rs:138–145  ·  view source on GitHub ↗

Creates a new drive for the current window.

()

Source from the content-addressed store, hash-verified

136impl WebDrive {
137 /// Creates a new drive for the current window.
138 pub fn from_window() -> Self {
139 // TODO(jmmv): Should probably do something fancier here instead of these unwraps...
140 let window = web_sys::window().unwrap();
141 let storage = window.local_storage().unwrap().unwrap();
142 let mut drive = Self { clock: Box::from(JsClock::default()), storage };
143 drive.fixup_names().unwrap();
144 drive
145 }
146
147 /// Upgrades the drive to support case insensitive behavior.
148 ///

Callers

nothing calls this directly

Calls 1

fixup_namesMethod · 0.80

Tested by

no test coverage detected