pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new( logger: Logger, access_key_id: String, secret_access_key: String, region: String, table_name: String, key_field: String, sort_key_field: Option<String>, endpoint: Option<String>, ) -> Self
pub fn get_client(&self) -> Client
pub async fn upsert<T>(&self, doc: T) -> Result<(), DynamoException>
pub async fn create<T>(&self, doc: T) -> Result<(), DynamoException>
pub async fn update<T>( &self, key: &str, fields: Vec<(&str, T)>, ) -> Result<(), DynamoException>
pub async fn delete(&self, key: &str) -> Result<(), DynamoException>
pub async fn get<T>(&self, key: &str) -> Result<Option<T>, DynamoException>where
T: Debug + DeserializeOwned,
pub async fn find<T, F>( &self, index: &str, bookmark: Option<String>, size: Option<i32>, filter: Vec<(&str, F)>, ) -> Result<(Option<Vec<T>>, Option<String>), DynamoException>
pub async fn increment( &self, key: &str, field: &str, value: i64, ) -> Result<(), DynamoException>
Source§impl Client
impl Client
pub async fn table_exists(&self) -> Result<bool, Error>
pub async fn list_tables(&self) -> Result<Vec<String>, Error>
pub async fn get_total_items(&self) -> Result<u64, Error>
pub async fn scan_table_items( &self, ) -> Result<Vec<HashMap<String, AttributeValue>>, Error>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.