euv_core/vdom/struct.rs
1use super::*;
2
3/// A raw HTML string that the renderer must insert
4/// without escaping.
5///
6/// Constructed via `RawHtml::new` (from Lombok `New`) or,
7/// preferably, the `unsafe_no_inline!` macro which makes
8/// the security warning loud at the call site.
9///
10/// The `content` field is `pub(crate)` with a public
11/// getter (`get_content`), a crate-internal mut-getter,
12/// and a crate-internal setter. The public getter lets
13/// the renderer read the unescaped content; the
14/// setter / mut-getter are kept crate-internal so the
15/// content is set at construction (preferably through
16/// `unsafe_no_inline!`) and not mutated after.
17#[derive(Clone, Data, Debug, Default, Eq, Hash, New, PartialEq)]
18pub struct RawHtml {
19 /// The unescaped HTML content.
20 #[get(pub)]
21 #[get_mut(pub(crate))]
22 #[set(pub(crate))]
23 pub(crate) content: String,
24}