Rust
Rust
Example: Http.S3_FileExists method
Demonstrates theS3_FileExists method.
Chilkat Rust Downloads
let http = chilkat::Http::new();
// Insert your AWS keys here:
http.set_aws_access_key("AWS_ACCESS_KEY");
http.set_aws_secret_key("AWS_SECRET_KEY");
let bucket_name = "chilkat.ocean".to_string();
let object_name = "seahorse.jpg".to_string();
http.set_aws_region("us-west-2");
http.set_aws_endpoint("s3-us-west-2.amazonaws.com");
let retval = http.s3_file_exists(&bucket_name, &object_name);
if retval < 0 {
println!("Failed to check for the S3 object existence");
println!("{}", http.last_error_text());
return;
}
if retval == 0 {
println!("The S3 object does not exist.");
return;
}
println!("The S3 object exists.");