1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! The [`Context`] trait and its implementors.
/// A marker trait to represent the context that the value is being rendered to.
///
/// This can be either [`Node`] or an [`AttributeValue`]. A [`Node`]
/// represents an HTML node, while an [`AttributeValue`] represents an attribute
/// value which will eventually be surrounded by double quotes.
///
/// This is used to ensure that the correct rendering methods are called
/// for each context, and to prevent errors such as accidentally rendering
/// an HTML element into an attribute value.
/// A marker type to represent a complete element node.
///
/// All types and traits that are generic over [`Context`] use [`Node`]
/// as the default for the generic type parameter.
///
/// Traits and types with this marker type expect complete HTML nodes. If
/// rendering string-like types, the value/implementation must escape `&` to
/// `&`, `<` to `<`, and `>` to `>`.
;
/// A marker type to represent an attribute value.
///
/// Traits and types with this marker type expect an attribute value which will
/// eventually be surrounded by double quotes. The value/implementation must
/// escape `&` to `&`, `<` to `<`, `>` to `>`, and `"` to `"`.
;