Skip to main content

set_web_source

Function set_web_source 

Source
pub fn set_web_source(source: String) -> Option<String>
Expand description

Replace the running document’s source, returning a parse error if the source is not loadable. No-op before start_web.

The source is checked here rather than in the event handler so the caller gets a synchronous answer it can put on screen. The running app parses it again when the event arrives; parsing is cheap next to a frame, and the alternative, plumbing a result back out through the event loop, would be far more machinery for the same outcome.