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 std::fmt::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>
impl<T> PartialEq for Secret<T>
source§impl<T> Serialize for Secret<T>
impl<T> Serialize for Secret<T>
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>
impl<T> StructuralPartialEq for Secret<T>where
T: Zeroize,
Auto Trait Implementations§
impl<T> Freeze for Secret<T>where
T: Freeze,
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