Skip to content

Commit 7167309

Browse files
committed
docs: methods of Template
1 parent 5bf03c6 commit 7167309

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/template.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ impl<SegmentResultIntoIter, Query> Template<SegmentResultIntoIter, Query>
3030
where
3131
SegmentResultIntoIter: IntoIterator,
3232
{
33+
/// Apply the template, and write the resulting segment outputs that implement [`fmt::Display`] to a
34+
/// buffer that implements [`fmt::Write`].
3335
pub fn write_to<Output, Segment, ParseError, RenderOutput, QueryOutput, QueryError, Respond>(
3436
self,
3537
output: &mut Output,
@@ -60,6 +62,7 @@ where
6062
Ok(())
6163
}
6264

65+
/// Apply the template, and send the resulting segment outputs to `handle_query_output`.
6366
fn apply<
6467
Segment,
6568
ParseError,

src/template/std_extensions.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ impl<SegmentResultIntoIter, Query> Template<SegmentResultIntoIter, Query>
99
where
1010
SegmentResultIntoIter: IntoIterator,
1111
{
12+
/// Apply the template, and join the resulting segment outputs together into a [`String`].
1213
pub fn to_string<Segment, ParseError, RenderOutput, QueryOutput, QueryError, Respond>(
1314
self,
1415
respond: Respond,
@@ -24,6 +25,8 @@ where
2425
Ok(buf)
2526
}
2627

28+
/// Apply the template, and write the resulting segment outputs that implement [`fmt::Display`] to a
29+
/// writer that implements [`io::Write`].
2730
pub fn to_writer<Writer, Segment, ParseError, RenderOutput, QueryOutput, QueryError, Respond>(
2831
self,
2932
writer: &mut Writer,

0 commit comments

Comments
 (0)