pub struct Declaration {
pub version: Option<String>,
pub encoding: Option<String>,
pub standalone: Option<String>,
}Fields§
§version: Option<String>§encoding: Option<String>§standalone: Option<String>Implementations§
Source§impl Declaration
impl Declaration
pub fn v1_0() -> Self
Sourcepub fn v1_1() -> Self
pub fn v1_1() -> Self
Examples found in repository?
examples/readme.rs (line 17)
5fn main() {
6 let mut doc = Document::from_str("<root><potato /></root>").unwrap();
7 let root = doc.root();
8
9 let potato = root
10 .query_selector(&doc, &Selector::new("potato").unwrap())
11 .unwrap();
12 potato.append_new_element(
13 &mut doc,
14 ("wow", [("easy", "true"), ("x", "200"), ("a-null", "\0")]),
15 );
16
17 let decl = Declaration::v1_1();
18 doc.set_declaration(Some(decl));
19 doc.set_doctype(Some("not-html"));
20
21 println!("{}", doc.to_string_pretty());
22}Trait Implementations§
Source§impl Clone for Declaration
impl Clone for Declaration
Source§fn clone(&self) -> Declaration
fn clone(&self) -> Declaration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Declaration
impl RefUnwindSafe for Declaration
impl Send for Declaration
impl Sync for Declaration
impl Unpin for Declaration
impl UnwindSafe for Declaration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more