pub trait SecretValue: Sized {
// Required methods
fn type_name() -> &'static str;
fn from_bytes(bytes: Vec<u8>, urn: &str) -> Result<Self, BindError>;
fn masked_size(&self) -> String;
}Expand description
Implemented by types that can be stored inside a Secret.
Provides the conversion from raw bytes returned by a source, the type label used in masked values, and a measurement of the value’s size.
Required Methods§
Sourcefn type_name() -> &'static str
fn type_name() -> &'static str
Short label included in the masked value, e.g. "string", "bytes", "json".
Sourcefn from_bytes(bytes: Vec<u8>, urn: &str) -> Result<Self, BindError>
fn from_bytes(bytes: Vec<u8>, urn: &str) -> Result<Self, BindError>
Construct a value from the raw bytes returned by a source.
Sourcefn masked_size(&self) -> String
fn masked_size(&self) -> String
Human-readable size/length included in the masked value, e.g. "12".
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.