¿Cómo guardar un archivo descargado de S3 con Rusoto en mi disco duro?
Estoy tratando de descargar un archivo de un bucket con Rusoto y obtengo el contenido del archivo:
fn get_object(client: &TestClient, bucket: &str, filename: &str) {
let get_req = GetObjectRequest {
bucket: bucket.to_owned(),
key: filename.to_owned(),
..Default::default()
};
let result = client.get_object(&get_req).sync().expect("Couldn't GET object");
let stream = result.body.unwrap();
let body = stream.concat2().wait().unwrap();
assert!(body.len() > 0);
}
¿Cómo puedo guardar estaGe,tObjectOutput(result)
objeto a un archivo?