pub struct EncryptedTable<D = Dynamo> { /* private fields */ }
Implementations§
source§impl<D> EncryptedTable<D>
impl<D> EncryptedTable<D>
pub fn cipher(&self) -> Arc<ZeroKmsCipher>
source§impl EncryptedTable<Headless>
impl EncryptedTable<Headless>
pub async fn init_headless() -> Result<Self, InitError>
pub async fn init_headless_with_zerokms_config( zerokms_config: ZeroKMSConfig<ClientKey>, ) -> Result<Self, InitError>
source§impl<D> EncryptedTable<D>
impl<D> EncryptedTable<D>
pub fn query<S>(&self) -> QueryBuilder<S, &Self>where
S: Searchable,
pub async fn decrypt_all<T>(
&self,
items: impl IntoIterator<Item = HashMap<String, AttributeValue>>,
) -> Result<Vec<T>, DecryptError>where
T: Decryptable + Identifiable,
pub async fn unseal<'a>( &self, spec: UnsealSpec<'a>, item: HashMap<String, AttributeValue>, ) -> Result<Unsealed, DecryptError>
pub async fn unseal_all<'a>( &self, spec: UnsealSpec<'a>, items: Vec<HashMap<String, AttributeValue>>, ) -> Result<Vec<Unsealed>, DecryptError>
pub async fn create_delete_patch( &self, delete: PreparedDelete, dataset_id: Option<DatasetId>, ) -> Result<DynamoRecordPatch, DeleteError>
sourcepub async fn create_put_patch(
&self,
record: PreparedRecord,
dataset_id: Option<DatasetId>,
index_predicate: impl FnMut(&AttributeName, &TableAttribute) -> bool,
) -> Result<DynamoRecordPatch, PutError>
pub async fn create_put_patch( &self, record: PreparedRecord, dataset_id: Option<DatasetId>, index_predicate: impl FnMut(&AttributeName, &TableAttribute) -> bool, ) -> Result<DynamoRecordPatch, PutError>
Create a DynamoRecordPatch
used to insert records into DynamoDB.
This will create a root record with all attributes and index records that only include
attributes specified by the index_predicate
. Use this predicate to only project certain
attributes into the index.
This patch will also include multiple delete items to remove any index keys that could be remaining in the database after updating a record.
source§impl EncryptedTable<Dynamo>
impl EncryptedTable<Dynamo>
pub async fn init( db: Client, table_name: impl Into<String>, ) -> Result<Self, InitError>
pub async fn init_with_zerokms_config( zerokms_config: ZeroKMSConfig<ClientKey>, db: Client, table_name: impl Into<String>, ) -> Result<Self, InitError>
sourcepub async fn get<T>(
&self,
k: impl Into<T::PrimaryKey>,
) -> Result<Option<T>, GetError>where
T: Decryptable + Identifiable,
pub async fn get<T>(
&self,
k: impl Into<T::PrimaryKey>,
) -> Result<Option<T>, GetError>where
T: Decryptable + Identifiable,
Get a record from the table by primary key from the default dataset.
sourcepub async fn get_via<T>(
&self,
k: impl Into<T::PrimaryKey>,
dataset_id: DatasetId,
) -> Result<Option<T>, GetError>where
T: Decryptable + Identifiable,
pub async fn get_via<T>(
&self,
k: impl Into<T::PrimaryKey>,
dataset_id: DatasetId,
) -> Result<Option<T>, GetError>where
T: Decryptable + Identifiable,
Get a record from the table by primary key from a specific dataset.
sourcepub async fn delete<E: Searchable + Identifiable>(
&self,
k: impl Into<E::PrimaryKey>,
) -> Result<(), DeleteError>
pub async fn delete<E: Searchable + Identifiable>( &self, k: impl Into<E::PrimaryKey>, ) -> Result<(), DeleteError>
Delete a record from the table by primary key from the default dataset.
sourcepub async fn delete_via<E: Searchable + Identifiable>(
&self,
k: impl Into<E::PrimaryKey>,
dataset_id: DatasetId,
) -> Result<(), DeleteError>
pub async fn delete_via<E: Searchable + Identifiable>( &self, k: impl Into<E::PrimaryKey>, dataset_id: DatasetId, ) -> Result<(), DeleteError>
Delete a record from the table by primary key from a specific dataset.
sourcepub async fn put<T>(&self, record: T) -> Result<(), PutError>where
T: Searchable + Identifiable,
pub async fn put<T>(&self, record: T) -> Result<(), PutError>where
T: Searchable + Identifiable,
Put a record into the table using the default dataset.
sourcepub async fn put_via<T>(
&self,
record: T,
dataset_id: DatasetId,
) -> Result<(), PutError>where
T: Searchable + Identifiable,
pub async fn put_via<T>(
&self,
record: T,
dataset_id: DatasetId,
) -> Result<(), PutError>where
T: Searchable + Identifiable,
Put a record into the table using a specific dataset.
Auto Trait Implementations§
impl<D> Freeze for EncryptedTable<D>where
D: Freeze,
impl<D = Dynamo> !RefUnwindSafe for EncryptedTable<D>
impl<D> Send for EncryptedTable<D>where
D: Send,
impl<D> Sync for EncryptedTable<D>where
D: Sync,
impl<D> Unpin for EncryptedTable<D>where
D: Unpin,
impl<D = Dynamo> !UnwindSafe for EncryptedTable<D>
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
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more