1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use ;
/// Conversion into a [`Collector`].
///
/// By implementing this trait for a type, you define how it will be converted to a collector.
///
/// # Usage in trait bounds
///
/// Using `IntoCollectorBase` in trait bounds allows a function to be generic over both
/// [`CollectorBase`] and `IntoCollectorBase`.
/// This is convenient for users of the function, so when they are using it
/// they do not have to make an extra call to
/// [`IntoCollectorBase::into_collector()`] to obtain an instance of [`Collector`].
///
/// Prefer [`IntoCollector`] whenever possible. [`IntoCollector`] can specify
/// the item type more easily, instead of writing
/// `C: IntoCollectorBase<IntoCollector: Collector<T>>`.
/// A trait alias for [`IntoCollectorBase`] types that has its collector
/// implement [`Collector`].
///
/// This trait is automatically implemented for such types.
///
/// Users generally should prefer this bound if they want to specify the
/// item type they need, instead of writing
/// `C: IntoCollectorBase<IntoCollector: Collector<T>>`.