pub struct ColumnEncryptionPolicy { /* private fields */ }Expand description
列级加密策略
存储列级加密配置,键为 table.column。
Implementations§
Source§impl ColumnEncryptionPolicy
impl ColumnEncryptionPolicy
Sourcepub fn new() -> ColumnEncryptionPolicy
pub fn new() -> ColumnEncryptionPolicy
创建空策略
Sourcepub fn from_configs(configs: Vec<ColumnCryptoConfig>) -> ColumnEncryptionPolicy
pub fn from_configs(configs: Vec<ColumnCryptoConfig>) -> ColumnEncryptionPolicy
从配置列表创建
Sourcepub fn add_column(&mut self, config: ColumnCryptoConfig) -> Result<(), String>
pub fn add_column(&mut self, config: ColumnCryptoConfig) -> Result<(), String>
添加列策略
校验 table 和 column 非空。
Sourcepub fn is_encrypted(&self, table: &str, column: &str) -> bool
pub fn is_encrypted(&self, table: &str, column: &str) -> bool
列是否需要加密
Sourcepub fn reload(&mut self, configs: Vec<ColumnCryptoConfig>)
pub fn reload(&mut self, configs: Vec<ColumnCryptoConfig>)
热更新:替换全部策略
Sourcepub fn all_configs(&self) -> Vec<&ColumnCryptoConfig>
pub fn all_configs(&self) -> Vec<&ColumnCryptoConfig>
获取所有配置
Trait Implementations§
Source§impl Default for ColumnEncryptionPolicy
impl Default for ColumnEncryptionPolicy
Source§fn default() -> ColumnEncryptionPolicy
fn default() -> ColumnEncryptionPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ColumnEncryptionPolicy
impl RefUnwindSafe for ColumnEncryptionPolicy
impl Send for ColumnEncryptionPolicy
impl Sync for ColumnEncryptionPolicy
impl Unpin for ColumnEncryptionPolicy
impl UnsafeUnpin for ColumnEncryptionPolicy
impl UnwindSafe for ColumnEncryptionPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more