@@ -66,7 +66,7 @@ pub struct VElement<'a, T: OutputType + 'a> {
66
66
/// [TextNode]: struct.TextNode.html
67
67
/// [elements]: ../elements/index.html
68
68
/// [vnode]: #tymethod.vnode
69
- pub trait Node < T : OutputType > : Display {
69
+ pub trait Node < T : OutputType + Send > : Display + Send {
70
70
/// Render the node into a [`VNode`][VNode] tree.
71
71
///
72
72
/// [VNode]: enum.VNode.html
@@ -75,7 +75,7 @@ pub trait Node<T: OutputType>: Display {
75
75
76
76
impl < T > IntoIterator for Box < dyn Node < T > >
77
77
where
78
- T : OutputType ,
78
+ T : OutputType + Send ,
79
79
{
80
80
type Item = Box < dyn Node < T > > ;
81
81
type IntoIter = std:: vec:: IntoIter < Box < dyn Node < T > > > ;
90
90
/// All [HTML elements][elements] implement this.
91
91
///
92
92
/// [elements]: ../elements/index.html
93
- pub trait Element < T : OutputType > : Node < T > {
93
+ pub trait Element < T : OutputType + Send > : Node < T > {
94
94
/// Get the name of the element.
95
95
fn name ( ) -> & ' static str ;
96
96
/// Get a list of the attribute names for this element.
@@ -112,7 +112,7 @@ pub trait Element<T: OutputType>: Node<T> {
112
112
}
113
113
114
114
/// An HTML text node.
115
- pub struct TextNode < T : OutputType > ( String , PhantomData < T > ) ;
115
+ pub struct TextNode < T : OutputType + Send > ( String , PhantomData < T > ) ;
116
116
117
117
/// Macro for creating text nodes.
118
118
///
@@ -146,7 +146,7 @@ macro_rules! text {
146
146
147
147
/// An unsafe HTML text node.
148
148
/// This is like TextNode, but no escaping will be performed when this node is displayed.
149
- pub struct UnsafeTextNode < T : OutputType > ( String , PhantomData < T > ) ;
149
+ pub struct UnsafeTextNode < T : OutputType + Send > ( String , PhantomData < T > ) ;
150
150
151
151
/// Macro for creating unescaped text nodes.
152
152
///
@@ -186,7 +186,7 @@ macro_rules! unsafe_text {
186
186
} ;
187
187
}
188
188
189
- impl < T : OutputType > TextNode < T > {
189
+ impl < T : OutputType + Send > TextNode < T > {
190
190
/// Construct a text node.
191
191
///
192
192
/// The preferred way to construct a text node is with the [`text!()`][text]
@@ -198,19 +198,19 @@ impl<T: OutputType> TextNode<T> {
198
198
}
199
199
}
200
200
201
- impl < T : OutputType > Display for TextNode < T > {
201
+ impl < T : OutputType + Send > Display for TextNode < T > {
202
202
fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> Result < ( ) , std:: fmt:: Error > {
203
203
f. write_str ( & encode_minimal ( & self . 0 ) )
204
204
}
205
205
}
206
206
207
- impl < T : OutputType > Node < T > for TextNode < T > {
207
+ impl < T : OutputType + Send > Node < T > for TextNode < T > {
208
208
fn vnode ( & ' _ mut self ) -> VNode < ' _ , T > {
209
209
VNode :: Text ( & self . 0 )
210
210
}
211
211
}
212
212
213
- impl < T : OutputType > IntoIterator for TextNode < T > {
213
+ impl < T : OutputType + Send > IntoIterator for TextNode < T > {
214
214
type Item = TextNode < T > ;
215
215
type IntoIter = std:: vec:: IntoIter < TextNode < T > > ;
216
216
@@ -219,7 +219,7 @@ impl<T: OutputType> IntoIterator for TextNode<T> {
219
219
}
220
220
}
221
221
222
- impl < T : OutputType > IntoIterator for Box < TextNode < T > > {
222
+ impl < T : OutputType + Send > IntoIterator for Box < TextNode < T > > {
223
223
type Item = Box < TextNode < T > > ;
224
224
type IntoIter = std:: vec:: IntoIter < Box < TextNode < T > > > ;
225
225
@@ -228,10 +228,10 @@ impl<T: OutputType> IntoIterator for Box<TextNode<T>> {
228
228
}
229
229
}
230
230
231
- impl < T : OutputType > FlowContent < T > for TextNode < T > { }
232
- impl < T : OutputType > PhrasingContent < T > for TextNode < T > { }
231
+ impl < T : OutputType + Send > FlowContent < T > for TextNode < T > { }
232
+ impl < T : OutputType + Send > PhrasingContent < T > for TextNode < T > { }
233
233
234
- impl < T : OutputType > UnsafeTextNode < T > {
234
+ impl < T : OutputType + Send > UnsafeTextNode < T > {
235
235
/// Construct a unsafe text node.
236
236
///
237
237
/// The preferred way to construct a unsafe text node is with the [`unsafe_text!()`][unsafe_text]
@@ -243,19 +243,19 @@ impl<T: OutputType> UnsafeTextNode<T> {
243
243
}
244
244
}
245
245
246
- impl < T : OutputType > Display for UnsafeTextNode < T > {
246
+ impl < T : OutputType + Send > Display for UnsafeTextNode < T > {
247
247
fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> Result < ( ) , std:: fmt:: Error > {
248
248
f. write_str ( & self . 0 )
249
249
}
250
250
}
251
251
252
- impl < T : OutputType > Node < T > for UnsafeTextNode < T > {
252
+ impl < T : OutputType + Send > Node < T > for UnsafeTextNode < T > {
253
253
fn vnode ( & ' _ mut self ) -> VNode < ' _ , T > {
254
254
VNode :: UnsafeText ( & self . 0 )
255
255
}
256
256
}
257
257
258
- impl < T : OutputType > IntoIterator for UnsafeTextNode < T > {
258
+ impl < T : OutputType + Send > IntoIterator for UnsafeTextNode < T > {
259
259
type Item = UnsafeTextNode < T > ;
260
260
type IntoIter = std:: vec:: IntoIter < UnsafeTextNode < T > > ;
261
261
@@ -264,7 +264,7 @@ impl<T: OutputType> IntoIterator for UnsafeTextNode<T> {
264
264
}
265
265
}
266
266
267
- impl < T : OutputType > IntoIterator for Box < UnsafeTextNode < T > > {
267
+ impl < T : OutputType + Send > IntoIterator for Box < UnsafeTextNode < T > > {
268
268
type Item = Box < UnsafeTextNode < T > > ;
269
269
type IntoIter = std:: vec:: IntoIter < Box < UnsafeTextNode < T > > > ;
270
270
@@ -273,5 +273,5 @@ impl<T: OutputType> IntoIterator for Box<UnsafeTextNode<T>> {
273
273
}
274
274
}
275
275
276
- impl < T : OutputType > FlowContent < T > for UnsafeTextNode < T > { }
277
- impl < T : OutputType > PhrasingContent < T > for UnsafeTextNode < T > { }
276
+ impl < T : OutputType + Send > FlowContent < T > for UnsafeTextNode < T > { }
277
+ impl < T : OutputType + Send > PhrasingContent < T > for UnsafeTextNode < T > { }
0 commit comments