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§fn clone(&self) -> AttributeValue
fn clone(&self) -> AttributeValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttributeValue
impl Debug for AttributeValue
Source§impl<'de> Deserialize<'de> for AttributeValue
impl<'de> Deserialize<'de> for AttributeValue
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for AttributeValue
impl Display for AttributeValue
Source§impl From<&[u8]> for AttributeValue
impl From<&[u8]> for AttributeValue
Source§impl From<&str> for AttributeValue
impl From<&str> for AttributeValue
Source§impl From<HashMap<String, AttributeValue>> for AttributeValue
impl From<HashMap<String, AttributeValue>> for AttributeValue
Source§impl From<String> for AttributeValue
impl From<String> for AttributeValue
Source§impl From<Vec<AttributeValue>> for AttributeValue
impl From<Vec<AttributeValue>> for AttributeValue
Source§fn from(value: Vec<AttributeValue>) -> Self
fn from(value: Vec<AttributeValue>) -> Self
Source§impl From<bool> for AttributeValue
impl From<bool> for AttributeValue
Source§impl From<i8> for AttributeValue
impl From<i8> for AttributeValue
Source§impl From<i16> for AttributeValue
impl From<i16> for AttributeValue
Source§impl From<i32> for AttributeValue
impl From<i32> for AttributeValue
Source§impl From<i64> for AttributeValue
impl From<i64> for AttributeValue
Source§impl From<i128> for AttributeValue
impl From<i128> for AttributeValue
Source§impl From<u8> for AttributeValue
impl From<u8> for AttributeValue
Source§impl From<u16> for AttributeValue
impl From<u16> for AttributeValue
Source§impl From<u32> for AttributeValue
impl From<u32> for AttributeValue
Source§impl From<u64> for AttributeValue
impl From<u64> for AttributeValue
Source§impl From<u128> for AttributeValue
impl From<u128> for AttributeValue
Source§impl PartialEq for AttributeValue
impl PartialEq for AttributeValue
Source§fn eq(&self, other: &AttributeValue) -> bool
fn eq(&self, other: &AttributeValue) -> bool
self and other values to be equal, and is used by ==.