Struct lock_keeper::crypto::secure_structs::SecureString
source · pub struct SecureString {
string: String,
}
Expand description
Wrapper around a String
that hold sensitive/secret data. All the bytes
are zeroized (zeroed out) whenever the value is dropped.
This type should be used anytime you need a String
that holds
sensitive or secret information.
Note: We purposely restrict the API to minimize accidental leaking and copying of data. Think carefully before adding new methods!
Fields§
§string: String
Implementations§
source§impl SecureString
impl SecureString
sourcepub fn from_str_slice(string: &str) -> SecureString
pub fn from_str_slice(string: &str) -> SecureString
Useful function for converting our test KMS_ARN into a SecureString. This should only be used in non-production code! As of the writing of this doc-string, there is no reason to use this in prod code.
sourcepub fn from_string(string: String) -> SecureString
pub fn from_string(string: String) -> SecureString
Convert an existing string
to a SecureString
by taking ownership of
its data; this ensures no copies are made.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
source§impl AsRef<str> for SecureString
impl AsRef<str> for SecureString
source§impl Clone for SecureString
impl Clone for SecureString
source§fn clone(&self) -> SecureString
fn clone(&self) -> SecureString
Returns a copy 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 SecureString
impl Debug for SecureString
source§impl Default for SecureString
impl Default for SecureString
source§fn default() -> SecureString
fn default() -> SecureString
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for SecureString
impl<'de> Deserialize<'de> for SecureString
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Drop for SecureString
impl Drop for SecureString
source§impl PartialEq for SecureString
impl PartialEq for SecureString
source§fn eq(&self, other: &SecureString) -> bool
fn eq(&self, other: &SecureString) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SecureString
impl Serialize for SecureString
impl Eq for SecureString
impl StructuralPartialEq for SecureString
Auto Trait Implementations§
impl Freeze for SecureString
impl RefUnwindSafe for SecureString
impl Send for SecureString
impl Sync for SecureString
impl Unpin for SecureString
impl UnwindSafe for SecureString
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> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
impl<T> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
fn from_message(value: Message) -> Result<Self, LockKeeperError>
fn to_message(self) -> Result<Message, LockKeeperError>
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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request