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 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>
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>
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe 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> 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.