docs.rs failed to build dynomite-derive-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
dynomite-derive-0.10.0
Dynomite-derive provides procedural macros for deriving dynamo types for your structs
examples
extern crate rusoto_dynamodb;
#[macro_use]
extern crate dynomite_derive;
extern crate dynomite;
use dynomite::{Item, FromAttributes, Attributes};
use rusoto_dynamodb::AttributeValue;
// derive Item
#[derive(Item, PartialEq, Debug, Clone)]
struct Person {
#[hash] id: String
}
fn main() {
let person = Person { id: "123".into() };
// convert person to string keys and attribute values
let attributes: Attributes = person.clone().into();
// convert attributes into person type
assert_eq!(person, Person::from_attrs(attributes).unwrap());
// dynamodb types require only primary key attributes and may contain
// other fields. when looking up items only those key attributes are required
// dynomite derives a new {Name}Key struct for your which contains
// only those and also implements Item
let key = PersonKey { id: "123".into() };
let key_attributes: Attributes = key.clone().into();
// convert attributes into person type
assert_eq!(key, PersonKey::from_attrs(key_attributes).unwrap());
}