dioxus_use_document/hooks/
builder.rs

1use super::*;
2use crate::hooks::use_document::UseDocument;
3
4pub struct UseDocumentBuilder {}
5
6impl Default for UseDocumentBuilder {
7    fn default() -> Self {
8        Self {}
9    }
10}
11
12impl UseDocumentBuilder {
13    pub fn use_document<'a>(&self, cx: &'a ScopeState) -> &'a mut UseDocument {
14        let hook = UseDocument::new(cx).unwrap();
15        cx.use_hook(|| hook)
16    }
17    pub fn use_title<'a>(&self, cx: &'a ScopeState) -> &'a mut UseTitle {
18        let hook = UseTitle::new(cx).unwrap();
19        cx.use_hook(|| hook)
20    }
21    pub fn use_charset<'a>(&self, cx: &'a ScopeState) -> &'a mut UseCharacterSet {
22        let hook = UseCharacterSet::new(cx).unwrap();
23        cx.use_hook(|| hook)
24    }
25}