pub struct SearchIterator<'a> { /* private fields */ }Expand description
Iterator for paginating through search results.
Implementations§
Source§impl<'a> SearchIterator<'a>
impl<'a> SearchIterator<'a>
Sourcepub fn new(
client: &'a Client,
query: impl Into<String>,
options: Option<SearchOptions>,
) -> Self
pub fn new( client: &'a Client, query: impl Into<String>, options: Option<SearchOptions>, ) -> Self
Create a new search iterator.
Sourcepub async fn next(&mut self) -> Result<Option<PostsResponse>>
pub async fn next(&mut self) -> Result<Option<PostsResponse>>
Fetch the next page. Returns None when exhausted.
Sourcepub async fn collect_all(&mut self) -> Result<Vec<Post>>
pub async fn collect_all(&mut self) -> Result<Vec<Post>>
Collect all remaining pages into a single Vec<Post>.
Auto Trait Implementations§
impl<'a> Freeze for SearchIterator<'a>
impl<'a> !RefUnwindSafe for SearchIterator<'a>
impl<'a> Send for SearchIterator<'a>
impl<'a> Sync for SearchIterator<'a>
impl<'a> Unpin for SearchIterator<'a>
impl<'a> UnsafeUnpin for SearchIterator<'a>
impl<'a> !UnwindSafe for SearchIterator<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more