pub async fn head_object<S: AsRef<str>>(&self, path: S) -> Result<(HeadObjectResult, u16)> {
        let command = Command::HeadObject;
        let request = Request::new(self, path.as_ref(), command);
        let (headers, status) = request.response_header_future().await?;
        let header_object = HeadObjectResult::from(&headers);
        Ok((header_object, status))
    }
/// Head object from S3, async.
/// # Example:
///
/// ```rust,no_run
/// use s3::bucket::Bucket;
/// use s3::creds::Credentials;
/// use s3::S3Error;
/// #[tokio::main]
/// async fn main() -> Result<(), S3Error> {
///     let bucket_name = &"rust-s3-test";
///     let region = "us-east-1".parse()?;
///     let credentials = Credentials::default()?;
///     let bucket = Bucket::new(bucket_name, region, credentials)?;
///     let (head_object_result, code) = bucket.head_object("/test.png").await.unwrap();
///     assert_eq!(head_object_result.content_type.unwrap() , "image/png".to_owned());
///     Ok(())
/// }
/// ```
Head object from S3, async.
Head object from S3 async .
pub async fn head_object<S: AsRef<str>>(&self, path: S) -> Result<(HeadObjectResult, u16)> {
        let command = Command::HeadObject;
        let request = Request::new(self, path.as_ref(), command);
        let (headers, status) = request.response_header_future().await?;
        let header_object = HeadObjectResult::from(&headers);
        Ok((header_object, status))
    }
pub async fn head_object < S : AsRef < str > > ( & self , path : S ) -> Result < ( HeadObjectResult , u16 ) > { let command = Command :: HeadObject ; let request = Request :: new ( self , path . as_ref ( ) , command ) ; let ( headers , status ) = request . response_header_future ( ) . await ? ; let header_object = HeadObjectResult :: from ( & headers ) ; Ok ( ( header_object , status ) ) }
Head object from S3, async.
Head object from S3 async .
&self
path
S
&self
path
S
example:
```rust,no_run
use s3::bucket::Bucket;
use s3::creds::Credentials;
use s3::S3Error.
` ` ` rust no_run use s3 :: bucket :: Bucket ; use s3 :: creds :: Credentials ; use s3 :: S3Error .
[tokio::main]
async fn main() -> Result<(), S3Error> {
let bucket_name = &"rust-s3-test";
let region = "us-east-1".parse()?;
let credentials = Credentials::default()?;
let bucket = Bucket::new(bucket_name, region, credentials)?;
let (head_object_result, code) = bucket.head_object("/test.png").await.unwrap();
assert_eq!(head_object_result.content_type.unwrap() , "image/png".to_owned());
Ok(())
}
```
async fn main () - > Result< () S3Error > { let bucket_name = & " rust - s3 - test " ; let region = " us - east - 1 " . parse () ? ; let credentials = Credentials :: default () ? ; let bucket = Bucket :: new ( bucket_name region credentials ) ? ; let ( head_object_result code ) = bucket . head_object ( " / test . png " ) . await . unwrap () ; assert_eq! ( head_object_result . content_type . unwrap () " image / png " . to_owned () ) ; Ok (( )) } ` ` `