Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit c4cce61

Browse files
author
Hendrik van Antwerpen
committed
Add documentation to ToAppendable and Candidates traits
1 parent 2a355f3 commit c4cce61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stack-graphs/src/stitching.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ impl Appendable for PartialPath {
156156
//-------------------------------------------------------------------------------------------------
157157
// ToAppendable
158158

159+
/// A trait to be implemented on types such as [`Database`][] that allow converting handles
160+
/// to appendables.
161+
///
162+
/// It is very similar to the [`std::ops::Index`] trait, but returns a reference instead
163+
/// of a value, such that an efficient identifity implementation is possible, that doesn't
164+
/// require cloning values.
159165
pub trait ToAppendable<H, A>
160166
where
161167
A: Appendable,
@@ -166,6 +172,8 @@ where
166172
//-------------------------------------------------------------------------------------------------
167173
// Candidates
168174

175+
/// A trait to support finding candidates for partial path extension. Requires an accompanying
176+
/// [`ToAppendable`] implementation to convert the candidate handles into [`Appendable`]s.
169177
pub trait Candidates<H> {
170178
fn find_candidates<R>(
171179
&mut self,

0 commit comments

Comments
 (0)