Crates.io | serde_dynamodb |
lib.rs | serde_dynamodb |
version | 0.9.0 |
source | src |
created_at | 2018-03-16 08:10:05.428364 |
updated_at | 2021-06-30 22:13:23.678536 |
description | de/serialize struct to HashMap |
homepage | https://github.com/mockersf/serde_dynamodb |
repository | https://github.com/mockersf/serde_dynamodb |
max_upload_size | |
id | 55917 |
size | 128,641 |
Library to de/serialize an object to an HashMap
of AttributeValue
s used by rusoto_dynamodb to manipulate objects saved in dynamodb using serde
#[derive(Serialize, Deserialize)]
struct Todo {
id: uuid::Uuid,
title: &'static str,
done: bool,
}
let todo = Todo {
id: uuid::Uuid::new_v4(),
title: "publish crate",
done: false,
};
let put_item = PutItemInput {
item: serde_dynamodb::to_hashmap(&todo).unwrap(),
table_name: "todos".to_string(),
..Default::default()
};
let client = DynamoDbClient::simple(Region::UsEast1);
client.put_item(&put_item).unwrap();