serde_dynamodb

Crates.ioserde_dynamodb
lib.rsserde_dynamodb
version0.9.0
sourcesrc
created_at2018-03-16 08:10:05.428364
updated_at2021-06-30 22:13:23.678536
descriptionde/serialize struct to HashMap with Serde to use with Rusoto DynamoDB
homepagehttps://github.com/mockersf/serde_dynamodb
repositoryhttps://github.com/mockersf/serde_dynamodb
max_upload_size
id55917
size128,641
François Mockers (mockersf)

documentation

https://docs.rs/serde_dynamodb

README

serde_dynamodb License: MIT Release Doc Crate

Library to de/serialize an object to an HashMap of AttributeValues used by rusoto_dynamodb to manipulate objects saved in dynamodb using serde

Example

#[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();
Commit count: 194

cargo fmt