pub enum AttributeValue {
S(String),
N(String),
B(Vec<u8>),
BOOL(bool),
NULL(bool),
SS(Vec<String>),
NS(Vec<String>),
BS(Vec<Vec<u8>>),
L(Vec<AttributeValue>),
M(HashMap<String, AttributeValue>),
}Expand description
DynamoDB AttributeValue - the core type system.
Each variant corresponds to a DynamoDB type descriptor: S (String), N (Number as string), B (Binary), BOOL, NULL, SS (String Set), NS (Number Set), BS (Binary Set), L (List), M (Map).
Variants§
S(String)
String type
N(String)
Number type - stored as string per DynamoDB convention
B(Vec<u8>)
Binary type - raw bytes, serialized as base64
BOOL(bool)
Boolean type
NULL(bool)
Null type
SS(Vec<String>)
String Set
NS(Vec<String>)
Number Set - each number stored as string
BS(Vec<Vec<u8>>)
Binary Set - each element is raw bytes
L(Vec<AttributeValue>)
List - ordered collection of AttributeValues
M(HashMap<String, AttributeValue>)
Map - key-value pairs
Implementations§
Source§impl AttributeValue
impl AttributeValue
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Calculate the size of this attribute value in bytes, following DynamoDB’s item size calculation rules.
This does NOT include the attribute name - the caller is responsible for adding the name’s UTF-8 byte length.
Sourcepub fn type_name(&self) -> &'static str
pub fn type_name(&self) -> &'static str
Returns the DynamoDB type descriptor string for this value.
Sourcepub fn to_key_string(&self) -> Option<String>
pub fn to_key_string(&self) -> Option<String>
Serialize this value to a deterministic TEXT representation for use as a SQLite primary key column (pk or sk).
- S: stored as-is (UTF-8 text sorts correctly)
- N: normalized to a comparable string encoding
- B: hex-encoded (preserves byte ordering)
Trait Implementations§
Source§impl Clone for AttributeValue
impl Clone for AttributeValue
Source§impl Debug for AttributeValue
The derived form, except that a map’s entries are written in key order.
A map is a HashMap, so its own order is drawn afresh for every map, and
two equal maps decoded by two requests would otherwise print differently.
A PartiQL NextToken is bound to its statement’s printed form, so it relies
on equal values printing alike.
impl Debug for AttributeValue
The derived form, except that a map’s entries are written in key order.
A map is a HashMap, so its own order is drawn afresh for every map, and
two equal maps decoded by two requests would otherwise print differently.
A PartiQL NextToken is bound to its statement’s printed form, so it relies
on equal values printing alike.