Struct shuttle_service::Secret
source · pub struct Secret<T>(/* private fields */)
where
T: Zeroize;Expand description
Wrapper type for secret values such as passwords or authentication keys.
Once wrapped, the inner value cannot leak accidentally, as both the [Display] and Debug
implementations cover up the actual value and only show the type.
If you need access to the inner value, there is an expose method.
To make sure nothing leaks after the Secret has been dropped, a custom Drop
implementation will zero-out the underlying memory.
Implementations§
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Secret<T>where
T: Zeroize + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Secret<T>where
T: Zeroize + Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Secret<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Secret<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T> PartialEq for Secret<T>where
T: PartialEq + Zeroize,
impl<T> PartialEq for Secret<T>where
T: PartialEq + Zeroize,
source§impl<T> Serialize for Secret<T>where
T: Zeroize + Serialize,
impl<T> Serialize for Secret<T>where
T: Zeroize + Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Eq for Secret<T>where
T: Eq + Zeroize,
impl<T> StructuralEq for Secret<T>where
T: Zeroize,
impl<T> StructuralPartialEq for Secret<T>where
T: Zeroize,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Secret<T>where
T: RefUnwindSafe,
impl<T> Send for Secret<T>where
T: Send,
impl<T> Sync for Secret<T>where
T: Sync,
impl<T> Unpin for Secret<T>where
T: Unpin,
impl<T> UnwindSafe for Secret<T>where
T: UnwindSafe,
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<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.