pub struct KeepConfig { /* private fields */ }Expand description
Configuration that keeps selected segments visible while masking the remainder.
The policy operates on Unicode scalar values. If the configuration keeps the entire value visible, the output is unchanged.
Use the constructor methods KeepConfig::first and KeepConfig::last
to create instances.
Implementations§
Source§impl KeepConfig
impl KeepConfig
Sourcepub fn first(visible_prefix: usize) -> Self
pub fn first(visible_prefix: usize) -> Self
Constructs a configuration that keeps only the first visible_prefix scalar values.
Sourcepub fn last(visible_suffix: usize) -> Self
pub fn last(visible_suffix: usize) -> Self
Constructs a configuration that keeps only the last visible_suffix scalar values.
Sourcepub fn both(visible_prefix: usize, visible_suffix: usize) -> Self
pub fn both(visible_prefix: usize, visible_suffix: usize) -> Self
Constructs a configuration that keeps both leading and trailing characters visible.
If visible_prefix + visible_suffix >= total_length, the entire value
is kept visible (no masking occurs).
Sourcepub fn with_mask_char(self, mask_char: char) -> Self
pub fn with_mask_char(self, mask_char: char) -> Self
Uses a specific masking character.
Trait Implementations§
Source§impl Clone for KeepConfig
impl Clone for KeepConfig
Source§fn clone(&self) -> KeepConfig
fn clone(&self) -> KeepConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeepConfig
impl Debug for KeepConfig
impl Copy for KeepConfig
Auto Trait Implementations§
impl Freeze for KeepConfig
impl RefUnwindSafe for KeepConfig
impl Send for KeepConfig
impl Sync for KeepConfig
impl Unpin for KeepConfig
impl UnwindSafe for KeepConfig
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