[][src]Trait dynomite::Attribute

pub trait Attribute: Sized {
    fn into_attr(self) -> AttributeValue;
fn from_attr(value: AttributeValue) -> Result<Self, AttributeError>; }

A type capable of being converted into an or from and AWS AttributeValue

Default implementations of this are provided for each type of AttributeValue field which map to naturally fitting native Rustlang types.

Examples

use dynomite::{dynamodb::AttributeValue, Attribute};

assert_eq!(
    "test".to_string().into_attr().s,
    AttributeValue {
        s: Some("test".to_string()),
        ..AttributeValue::default()
    }
    .s
);

Required methods

fn into_attr(self) -> AttributeValue

Returns a conversion into an AttributeValue

fn from_attr(value: AttributeValue) -> Result<Self, AttributeError>

Returns a fallible conversion from an AttributeValue

Loading content...

Implementations on Foreign Types

impl<A: Attribute> Attribute for HashMap<String, A>[src]

A Map type for Items for HashMaps, represented as the M AttributeValue type

impl<A: Attribute> Attribute for BTreeMap<String, A>[src]

A Map type for Items for BTreeMaps, represented as the M AttributeValue type

impl Attribute for Uuid[src]

A String type for Uuids, represented by the S AttributeValue type

impl Attribute for DateTime<Utc>[src]

An rfc3339 formatted version of DateTime<Utc>, represented by the S AttributeValue type

impl Attribute for DateTime<Local>[src]

An rfc3339 formatted version of DateTime<Local>, represented by the S AttributeValue type

impl Attribute for DateTime<FixedOffset>[src]

An rfc3339 formatted version of DateTime<FixedOffset>, represented by the S AttributeValue type

impl Attribute for SystemTime[src]

An rfc3339 formatted version of SystemTime, represented by the S AttributeValue type

impl Attribute for String[src]

A String type, represented by the S AttributeValue type

impl<'a> Attribute for Cow<'a, str>[src]

impl Attribute for HashSet<String>[src]

A String Set type, represented by the SS AttributeValue type

impl Attribute for BTreeSet<String>[src]

impl Attribute for HashSet<Vec<u8>>[src]

A Binary Set type, represented by the BS AttributeValue type

impl Attribute for bool[src]

impl Attribute for Bytes[src]

impl Attribute for Vec<u8>[src]

impl<A: Attribute> Attribute for Vec<A>[src]

A List type for vectors, represented by the L AttributeValue type

Note: Vectors support homogenious collection values. This means the default supported scalars do not permit cases where you need to store a list of heterogenus values. To accomplish this you'll need to implement a wrapper type that represents your desired variants and implement Attribute for YourType. An Vec<YourType> implementation will already be provided

impl<T: Attribute> Attribute for Option<T>[src]

impl Attribute for u16[src]

impl Attribute for i16[src]

impl Attribute for u32[src]

impl Attribute for i32[src]

impl Attribute for u64[src]

impl Attribute for i64[src]

impl Attribute for f32[src]

impl Attribute for f64[src]

impl Attribute for HashSet<u16>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for BTreeSet<u16>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for HashSet<i16>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for BTreeSet<i16>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for HashSet<u32>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for BTreeSet<u32>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for HashSet<i32>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for BTreeSet<i32>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for HashSet<i64>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for BTreeSet<i64>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for HashSet<u64>[src]

A Number set type, represented by the NS AttributeValue type

impl Attribute for BTreeSet<u64>[src]

A Number set type, represented by the NS AttributeValue type

Loading content...

Implementors

impl<T: Item> Attribute for T[src]

A Map type for Items, represented as the M AttributeValue type

Loading content...