MCPcopy Create free account
hub / github.com/DioxusLabs/dioxus / document

Function document

packages/document/src/lib.rs:14–24  ·  view source on GitHub ↗

Get the document provider for the current platform or a no-op provider if the platform doesn't document functionality.

()

Source from the content-addressed store, hash-verified

12
13/// Get the document provider for the current platform or a no-op provider if the platform doesn't document functionality.
14pub fn document() -> Rc<dyn Document> {
15 match dioxus_core::try_consume_context::<Rc<dyn Document>>() {
16 Some(document) => document,
17 None => {
18 tracing::error!(
19 "Unable to find a document in the renderer. Using the default no-op document."
20 );
21 Rc::new(NoOpDocument)
22 }
23 }
24}
25
26/// Evaluate some javascript in the current document
27#[doc = include_str!("../docs/eval.md")]

Callers 6

evalFunction · 0.85
StyleFunction · 0.85
LinkFunction · 0.85
ScriptFunction · 0.85
MetaFunction · 0.85
init_document_withFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected