Don't expose pageiter module, and add some docs to PageIter
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ pub mod instance;
|
||||
pub mod list;
|
||||
pub mod mention;
|
||||
pub mod notification;
|
||||
pub mod pageiter;
|
||||
mod pageiter;
|
||||
pub mod relationship;
|
||||
pub mod report;
|
||||
pub mod search_result;
|
||||
|
||||
@@ -29,6 +29,17 @@ into_pageiter!(Notification);
|
||||
into_pageiter!(Report);
|
||||
into_pageiter!(Relationship);
|
||||
|
||||
/// Abstracts away the `next_page` logic into a single stream of items
|
||||
///
|
||||
/// ```ignore
|
||||
/// # extern crate mammut
|
||||
/// # use mammut::Mastodon;
|
||||
/// let client = Mastodon::from_data(data);
|
||||
/// let statuses = client.statuses("user-id", None);
|
||||
/// for status in statuses.into_iter() {
|
||||
/// // do something with `status`
|
||||
/// }
|
||||
/// ```
|
||||
pub struct PageIter<'a, T: Clone + for<'de> Deserialize<'de>> {
|
||||
page: Page<'a, T>,
|
||||
buffer: Vec<T>,
|
||||
|
||||
Reference in New Issue
Block a user