Struct secstr::SecStr [] [src]

pub struct SecStr { /* fields omitted */ }

A data type suitable for storing sensitive information such as passwords and private keys in memory, that implements:

Be careful with SecStr::from: if you have a borrowed string, it will be copied.
Use SecStr::new if you have a Vec<u8>.

Methods

impl SecStr
[src]

Borrow the contents of the string.

Mutably borrow the contents of the string.

Overwrite the string with zeros. This is automatically called in the destructor.

Trait Implementations

impl Clone for SecStr
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> From<T> for SecStr where T: Into<Vec<u8>>
[src]

Performs the conversion.

impl Borrow<[u8]> for SecStr
[src]

Immutably borrows from an owned value. Read more

impl BorrowMut<[u8]> for SecStr
[src]

Mutably borrows from an owned value. Read more

impl Drop for SecStr
[src]

A method called when the value goes out of scope. Read more

impl PartialEq for SecStr
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for SecStr
[src]

Formats the value using the given formatter.

impl Display for SecStr
[src]

Formats the value using the given formatter.