Skip to main content

AttributeValue

Enum AttributeValue 

Source
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

Source

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.

Source

pub fn type_name(&self) -> &'static str

Returns the DynamoDB type descriptor string for this value.

Source

pub fn is_scalar(&self) -> bool

Returns true if this is a scalar type (S, N, B, BOOL, NULL).

Source

pub fn is_set(&self) -> bool

Returns true if this is a set type (SS, NS, BS).

Source

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

Source§

fn clone(&self) -> AttributeValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AttributeValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AttributeValue

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for AttributeValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&[u8]> for AttributeValue

Source§

fn from(value: &[u8]) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for AttributeValue

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<BTreeSet<String>> for AttributeValue

Source§

fn from(value: BTreeSet<String>) -> Self

Converts to this type from the input type.
Source§

impl From<HashMap<String, AttributeValue>> for AttributeValue

Source§

fn from(value: HashMap<String, AttributeValue>) -> Self

Converts to this type from the input type.
Source§

impl From<HashSet<String>> for AttributeValue

Source§

fn from(value: HashSet<String>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for AttributeValue

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<AttributeValue>> for AttributeValue

Source§

fn from(value: Vec<AttributeValue>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for AttributeValue

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for AttributeValue

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for AttributeValue

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for AttributeValue

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for AttributeValue

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for AttributeValue

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for AttributeValue

Source§

fn from(value: i128) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for AttributeValue

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for AttributeValue

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for AttributeValue

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for AttributeValue

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for AttributeValue

Source§

fn from(value: u128) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for AttributeValue

Source§

fn eq(&self, other: &AttributeValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AttributeValue

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AttributeValue

Source§

impl TryFrom<AttributeValue> for String

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for bool

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for Vec<u8>

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for i8

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for i16

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for i32

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for i64

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for i128

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for u8

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for u16

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for u32

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for u64

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for u128

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for f64

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for f32

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for HashMap<String, AttributeValue>

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for Vec<AttributeValue>

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<AttributeValue> for Vec<String>

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: AttributeValue) -> Result<Self, ConversionError>

Performs the conversion.
Source§

impl TryFrom<f32> for AttributeValue

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f64> for AttributeValue

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: f64) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> Fake for T

Source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

Source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: Rng + ?Sized, Self: FakeBase<U>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more