From b6d665186947732a4e178fa8d8297f990b35b213 Mon Sep 17 00:00:00 2001 From: "D. Scott Boggs" Date: Sun, 29 Jan 2023 06:05:55 -0500 Subject: [PATCH] Add a little more documentation --- src/mastodon.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mastodon.rs b/src/mastodon.rs index f59b4e7..68f976d 100644 --- a/src/mastodon.rs +++ b/src/mastodon.rs @@ -345,6 +345,21 @@ impl Mastodon { /// println!("{}", attachment.url); /// }); /// ``` + /// + /// For a different polling time, use `.into()` on a `std::time::Duration`. + /// ```rust,no_run + /// use mastodon_async::prelude::*; + /// use std::time::Duration; + /// let mastodon = Mastodon::from(Data::default()); + /// tokio_test::block_on(async { + /// let attachment = mastodon.media("/path/to/some/file.jpg", None).await.expect("upload"); + /// let attachment = mastodon.wait_for_processing( + /// attachment, + /// Duration::from_secs(1).into(), + /// ).await.expect("processing"); + /// println!("{}", attachment.url); + /// }); + /// ``` pub async fn wait_for_processing( &self, mut attachment: Attachment,