Skip to main content

DynamoTable

Struct DynamoTable 

Source
pub struct DynamoTable {
Show 27 fields pub name: String, pub arn: String, pub key_schema: Vec<KeySchemaElement>, pub attribute_definitions: Vec<AttributeDefinition>, pub provisioned_throughput: ProvisionedThroughput, pub items: Vec<HashMap<String, AttributeValue>>, pub gsi: Vec<GlobalSecondaryIndex>, pub lsi: Vec<LocalSecondaryIndex>, pub tags: HashMap<String, String>, pub created_at: DateTime<Utc>, pub status: String, pub item_count: i64, pub size_bytes: i64, pub billing_mode: String, pub ttl_attribute: Option<String>, pub ttl_enabled: bool, pub resource_policy: Option<String>, pub pitr_enabled: bool, pub kinesis_destinations: Vec<KinesisDestination>, pub contributor_insights_status: String, pub contributor_insights_counters: HashMap<String, u64>, pub stream_enabled: bool, pub stream_view_type: Option<String>, pub stream_arn: Option<String>, pub stream_records: Arc<RwLock<Vec<StreamRecord>>>, pub sse_type: Option<String>, pub sse_kms_key_arn: Option<String>,
}

Fields§

§name: String§arn: String§key_schema: Vec<KeySchemaElement>§attribute_definitions: Vec<AttributeDefinition>§provisioned_throughput: ProvisionedThroughput§items: Vec<HashMap<String, AttributeValue>>§gsi: Vec<GlobalSecondaryIndex>§lsi: Vec<LocalSecondaryIndex>§tags: HashMap<String, String>§created_at: DateTime<Utc>§status: String§item_count: i64§size_bytes: i64§billing_mode: String§ttl_attribute: Option<String>§ttl_enabled: bool§resource_policy: Option<String>§pitr_enabled: bool

PITR enabled

§kinesis_destinations: Vec<KinesisDestination>

Kinesis streaming destinations: stream_arn -> status

§contributor_insights_status: String

Contributor insights status

§contributor_insights_counters: HashMap<String, u64>

Contributor insights: partition key access counters (key_value_string -> count)

§stream_enabled: bool

DynamoDB Streams configuration

§stream_view_type: Option<String>§stream_arn: Option<String>§stream_records: Arc<RwLock<Vec<StreamRecord>>>

Stream records (retained for 24 hours)

§sse_type: Option<String>

Server-side encryption type: AES256 (owned) or KMS

§sse_kms_key_arn: Option<String>

KMS key ARN for SSE (only when sse_type is KMS)

Implementations§

Source§

impl DynamoTable

Source

pub fn hash_key_name(&self) -> &str

Get the hash key attribute name from the key schema.

Source

pub fn range_key_name(&self) -> Option<&str>

Get the range key attribute name from the key schema (if any).

Source

pub fn find_item_index( &self, key: &HashMap<String, AttributeValue>, ) -> Option<usize>

Find an item index by its primary key.

Source

pub fn record_key_access(&mut self, key: &HashMap<String, AttributeValue>)

Record a partition key access for contributor insights. Only records if contributor insights is enabled.

Source

pub fn record_item_access(&mut self, item: &HashMap<String, AttributeValue>)

Record a partition key access from a full item (extracts the key first).

Source

pub fn top_contributors(&self, n: usize) -> Vec<(&str, u64)>

Get top N contributors sorted by access count (descending).

Source

pub fn recalculate_stats(&mut self)

Recalculate item_count and size_bytes from the items vec.

Trait Implementations§

Source§

impl Clone for DynamoTable

Source§

fn clone(&self) -> DynamoTable

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DynamoTable

Source§

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

Formats the value using the given formatter. Read more

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> 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<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, 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<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
Source§

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