pub trait SerializableSecret: Serialize { }
Expand description
Marker trait for secret types which can be Serialize
-d by serde
.
When the serde
feature of this crate is enabled and types are marked with
this trait, they receive a Serialize
impl for SecretBox<T>
.
(NOTE: all types which impl DeserializeOwned
receive a Deserialize
impl)
This is done deliberately to prevent accidental exfiltration of secrets
via serde
serialization.
If you really want to have serde
serialize those types, use the
serialize_with
attribute to specify a serializer that exposes the secret.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.