Skip to content

Commit

Permalink
docs: methods of Template
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Oct 6, 2024
1 parent 5bf03c6 commit 7167309
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ impl<SegmentResultIntoIter, Query> Template<SegmentResultIntoIter, Query>
where
SegmentResultIntoIter: IntoIterator,
{
/// Apply the template, and write the resulting segment outputs that implement [`fmt::Display`] to a
/// buffer that implements [`fmt::Write`].
pub fn write_to<Output, Segment, ParseError, RenderOutput, QueryOutput, QueryError, Respond>(
self,
output: &mut Output,
Expand Down Expand Up @@ -60,6 +62,7 @@ where
Ok(())
}

/// Apply the template, and send the resulting segment outputs to `handle_query_output`.
fn apply<
Segment,
ParseError,
Expand Down
3 changes: 3 additions & 0 deletions src/template/std_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ impl<SegmentResultIntoIter, Query> Template<SegmentResultIntoIter, Query>
where
SegmentResultIntoIter: IntoIterator,
{
/// Apply the template, and join the resulting segment outputs together into a [`String`].
pub fn to_string<Segment, ParseError, RenderOutput, QueryOutput, QueryError, Respond>(
self,
respond: Respond,
Expand All @@ -24,6 +25,8 @@ where
Ok(buf)
}

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

0 comments on commit 7167309

Please sign in to comment.