pub struct SensitiveString(/* private fields */);Expand description
Redacted wrapper around a secret string.
Implementations§
Source§impl SensitiveString
impl SensitiveString
Sourcepub fn new(value: impl Into<String>) -> Self
pub fn new(value: impl Into<String>) -> Self
Create a new sensitive string from owned or borrowed input.
Sourcepub fn from_owned_string(value: String) -> Self
pub fn from_owned_string(value: String) -> Self
Build directly from an owned String.
Sourcepub fn from_utf8_bytes(value: Vec<u8>) -> Result<Self, FromUtf8Error>
pub fn from_utf8_bytes(value: Vec<u8>) -> Result<Self, FromUtf8Error>
Decode UTF-8 bytes into a sensitive string.
Trait Implementations§
Source§impl Clone for SensitiveString
impl Clone for SensitiveString
Source§fn clone(&self) -> SensitiveString
fn clone(&self) -> SensitiveString
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 SensitiveString
impl Debug for SensitiveString
Source§impl Default for SensitiveString
impl Default for SensitiveString
Source§fn default() -> SensitiveString
fn default() -> SensitiveString
Returns the “default value” for a type. Read more
Source§impl ExposeSecret<str> for SensitiveString
impl ExposeSecret<str> for SensitiveString
Source§fn expose_secret(&self) -> &str
fn expose_secret(&self) -> &str
Expose secret: this is the only method providing access to a secret.
Source§impl From<&str> for SensitiveString
impl From<&str> for SensitiveString
Source§impl From<String> for SensitiveString
impl From<String> for SensitiveString
Source§impl PartialEq for SensitiveString
impl PartialEq for SensitiveString
impl Eq for SensitiveString
Auto Trait Implementations§
impl Freeze for SensitiveString
impl RefUnwindSafe for SensitiveString
impl Send for SensitiveString
impl Sync for SensitiveString
impl Unpin for SensitiveString
impl UnsafeUnpin for SensitiveString
impl UnwindSafe for SensitiveString
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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