diff --git a/services/comm-services-lib/src/blob/client.rs b/services/comm-services-lib/src/blob/client.rs --- a/services/comm-services-lib/src/blob/client.rs +++ b/services/comm-services-lib/src/blob/client.rs @@ -72,6 +72,9 @@ /// /// # Example /// ```rust + /// # use comm_services_lib::blob::client::*; + /// # use futures_util::stream::TryStreamExt; + /// # async fn f() -> anyhow::Result<()> { /// let client = /// BlobServiceClient::new("http://localhost:50053".parse()?); /// @@ -79,6 +82,8 @@ /// while let Some(data) = stream.try_next().await? { /// println!("Got data: {:?}", data); /// } + /// # Ok(()) + /// # } /// ``` pub async fn get( &self, @@ -182,8 +187,9 @@ /// /// # Example /// ```rust + /// # use comm_services_lib::blob::client::*; /// use std::io::{Error, ErrorKind}; - /// + /// # async fn f() -> anyhow::Result<()> { /// let client = /// BlobServiceClient::new("http://localhost:50053".parse()?); /// @@ -192,7 +198,11 @@ /// yield Ok(vec![4, 5, 6]); /// yield Err(Error::new(ErrorKind::Other, "Oops")); /// }; + /// + /// # let blob_hash = "hash".to_string(); /// client.upload_blob(&blob_hash, stream).await?; + /// # Ok(()) + /// # } /// ``` pub async fn upload_blob( &self, diff --git a/services/comm-services-lib/src/database.rs b/services/comm-services-lib/src/database.rs --- a/services/comm-services-lib/src/database.rs +++ b/services/comm-services-lib/src/database.rs @@ -66,13 +66,15 @@ /// Conversion trait for [`AttributeValue`] /// /// Types implementing this trait are able to do the following: -/// ```rust +/// ``` /// use comm_services_lib::database::{TryFromAttribute, AttributeTryInto}; -/// -/// let foo = SomeType::try_from_attr("MyAttribute", Some(attribute)); +/// # let attribute = aws_sdk_dynamodb::types::AttributeValue::S("a".to_string()); +/// let foo = String::try_from_attr("MyAttribute", Some(attribute))?; /// /// // if `AttributeTryInto` is imported, also: -/// let bar = Some(attribute).attr_try_into("MyAttribute"); +/// # let attribute = aws_sdk_dynamodb::types::AttributeValue::S("a".to_string()); +/// let bar: String = Some(attribute).attr_try_into("MyAttribute")?; +/// # Ok::<(), comm_services_lib::database::DBItemError>(()) pub trait TryFromAttribute: Sized { fn try_from_attr( attribute_name: impl Into,