docx_rust/document/
bookmark_end.rs

1use hard_xml::{XmlRead, XmlWrite};
2use std::borrow::Cow;
3
4use crate::{__setter, __xml_test_suites};
5
6/// End of bookmark
7#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
8#[cfg_attr(test, derive(PartialEq))]
9#[xml(tag = "w:bookmarkEnd")]
10pub struct BookmarkEnd<'a> {
11    /// Specifies a unique identifier for the bookmark.
12    #[xml(attr = "w:id")]
13    pub id: Option<Cow<'a, str>>,
14}
15
16impl<'a> BookmarkEnd<'a> {
17    __setter!(id: Option<Cow<'a, str>>);
18}
19
20__xml_test_suites!(
21    BookmarkEnd,
22    BookmarkEnd::default(),
23    r#"<w:bookmarkEnd/>"#,
24    BookmarkEnd::default().id("id"),
25    r#"<w:bookmarkEnd w:id="id"/>"#,
26);