pub struct ValueRewriter { /* private fields */ }Expand description
Rewriter for INSERT and COPY statements
Implementations§
Source§impl ValueRewriter
impl ValueRewriter
Sourcepub fn new(seed: Option<u64>, dialect: SqlDialect, locale: String) -> Self
pub fn new(seed: Option<u64>, dialect: SqlDialect, locale: String) -> Self
Create a new rewriter with optional seed for reproducibility
Sourcepub fn rewrite_insert(
&mut self,
stmt: &[u8],
table_name: &str,
table: &TableSchema,
strategies: &[StrategyKind],
) -> Result<(Vec<u8>, u64, u64)>
pub fn rewrite_insert( &mut self, stmt: &[u8], table_name: &str, table: &TableSchema, strategies: &[StrategyKind], ) -> Result<(Vec<u8>, u64, u64)>
Rewrite an INSERT statement with redacted values
Sourcepub fn rewrite_copy(
&mut self,
stmt: &[u8],
_table_name: &str,
table: &TableSchema,
strategies: &[StrategyKind],
) -> Result<(Vec<u8>, u64, u64)>
pub fn rewrite_copy( &mut self, stmt: &[u8], _table_name: &str, table: &TableSchema, strategies: &[StrategyKind], ) -> Result<(Vec<u8>, u64, u64)>
Rewrite a COPY statement with redacted values (PostgreSQL)
Sourcepub fn rewrite_copy_data(
&mut self,
data_block: &[u8],
table: &TableSchema,
strategies: &[StrategyKind],
columns: &[String],
) -> Result<(Vec<u8>, u64, u64)>
pub fn rewrite_copy_data( &mut self, data_block: &[u8], table: &TableSchema, strategies: &[StrategyKind], columns: &[String], ) -> Result<(Vec<u8>, u64, u64)>
Rewrite just the COPY data block (header handled separately)
Auto Trait Implementations§
impl Freeze for ValueRewriter
impl RefUnwindSafe for ValueRewriter
impl Send for ValueRewriter
impl Sync for ValueRewriter
impl Unpin for ValueRewriter
impl UnwindSafe for ValueRewriter
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> 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 more