Skip to main content

SecretString

Type Alias SecretString 

Source
pub type SecretString = SecretBox<str>;
Expand description

Secret string type — mirrors secrecy::SecretString.

Type alias for SecretBox<str>. Construct from String or &str. Prefer Dynamic<String> for new code.

Aliased Type§

pub struct SecretString { /* private fields */ }

Trait Implementations§

Source§

impl Clone for SecretString

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for SecretString

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SecretString

Available on crate feature serde-deserialize only.
Source§

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<'a> From<&'a str> for SecretString

Source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
Source§

impl From<Dynamic<String>> for SecretString

Converts a Dynamic<String> into a SecretString (= SecretBox<str>).

Clones the inner string. Both ends are zeroized on drop.

Source§

fn from(d: Dynamic<String>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for SecretString

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl FromStr for SecretString

Source§

type Err = Infallible

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more