Skip to content

Commit e6f38e2

Browse files
committed
doc(sync): document the Source implementors
1 parent 42168ed commit e6f38e2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/r3/src/sync/source.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ pub trait Source<System> {
3636
C: ~const traits::CfgBase<System = System>;
3737
}
3838

39+
/// A [`Source`][] that provides a hunk initialized by
40+
/// [`Default::default`][].
3941
pub struct DefaultSource<T>(PhantomData<T>);
4042

4143
impl<T> Init for DefaultSource<T> {
@@ -60,6 +62,8 @@ where
6062
}
6163
}
6264

65+
/// A [`Source`][] that provides a hunk initialized by a user-provided
66+
/// initializer.
6367
pub struct NewBindSource<Binder, Func> {
6468
pub binder: Binder,
6569
pub func: Func,
@@ -85,6 +89,7 @@ where
8589
}
8690
}
8791

92+
/// A [`Source`][] that consumes a user-provided binding.
8893
pub struct TakeBindSource<'pool, System, T>(pub(crate) Bind<'pool, System, T>);
8994

9095
impl<System, T> const Source<System> for TakeBindSource<'_, System, T>
@@ -115,6 +120,8 @@ where
115120
}
116121
}
117122

123+
/// A [`Source`][] that provides a user-provided hunk, assuming the provider
124+
/// upholds the safety rules.
118125
pub struct HunkSource<System, T>(pub(crate) Hunk<System, UnsafeCell<MaybeUninit<T>>>);
119126

120127
impl<System, T> const Source<System> for HunkSource<System, T>

0 commit comments

Comments
 (0)