Add a little more documentation

This commit is contained in:
D. Scott Boggs 2023-01-29 06:05:55 -05:00 committed by Scott Boggs
parent 0cfe4d7db8
commit b6d6651869
1 changed files with 15 additions and 0 deletions

View File

@ -345,6 +345,21 @@ impl Mastodon {
/// println!("{}", attachment.url); /// 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( pub async fn wait_for_processing(
&self, &self,
mut attachment: Attachment, mut attachment: Attachment,