//! Lists every document in a collection, following pagination automatically. //! //! ```text //! OUTLINE_API_KEY=ol_api_... cargo run --example list_documents -- //! ``` use std::env; use outline::Client; #[tokio::main] async fn main() -> outline::Result<()> { let collection_id = env::args() .nth(1) .expect("usage: list_documents "); let client = Client::from_env()?; let mut documents = client .documents() .list() .collection_id(collection_id) .paginate(); while let Some(page) = documents.next_page().await? { for document in page.items { println!("{}\t{}", document.id, document.title); } } Ok(()) }