File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ pub trait Source {
62
62
63
63
/// Attempts to find the packages that match a dependency request.
64
64
///
65
+ /// Usually you should call [`Source::block_until_ready`] somewhere and
66
+ /// wait until package informations become available. Otherwise any query
67
+ /// may return a [`Poll::Pending`].
68
+ ///
65
69
/// The `f` argument is expected to get called when any [`Summary`] becomes available.
66
70
fn query (
67
71
& mut self ,
@@ -70,8 +74,8 @@ pub trait Source {
70
74
f : & mut dyn FnMut ( Summary ) ,
71
75
) -> Poll < CargoResult < ( ) > > ;
72
76
73
- /// A helper function that collects and returns the result from
74
- /// [`Source::query`] as a list of [`Summary`] items when available.
77
+ /// Gathers the result from [`Source::query`] as a list of [`Summary`] items
78
+ /// when they become available.
75
79
fn query_vec ( & mut self , dep : & Dependency , kind : QueryKind ) -> Poll < CargoResult < Vec < Summary > > > {
76
80
let mut ret = Vec :: new ( ) ;
77
81
self . query ( dep, kind, & mut |s| ret. push ( s) ) . map_ok ( |_| ret)
You can’t perform that action at this time.
0 commit comments