pub struct RedactorBuilder { /* private fields */ }Expand description
A checked builder for Redactors.
Implementations§
Source§impl RedactorBuilder
impl RedactorBuilder
Sourcepub const fn char(self, char: char) -> Self
pub const fn char(self, char: char) -> Self
Set the character to use for redacting.
Equivalent to #[redact(with = '...')] when deriving.
Sourcepub const fn str(self, str: &'static str) -> Self
pub const fn str(self, str: &'static str) -> Self
Set the string to use for redacting.
Equivalent to #[redact(with = "...")] when deriving.
Sourcepub const fn partial(self) -> Self
pub const fn partial(self) -> Self
Whether to only partially redact the data.
Equivalent to #[redact(partial)] when deriving.
Sourcepub const fn build(self) -> Result<Redactor, &'static str>
pub const fn build(self) -> Result<Redactor, &'static str>
Build the redaction flags.
Returns an error if the state of the builder is invalid.
The error will be optimised away by the compiler if the builder is valid at compile time, so it’s safe and zero-cost to use unwrap on the result if you are constructing this at compile time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RedactorBuilder
impl RefUnwindSafe for RedactorBuilder
impl Send for RedactorBuilder
impl Sync for RedactorBuilder
impl Unpin for RedactorBuilder
impl UnwindSafe for RedactorBuilder
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