Struct secret::SecretValue [] [src]

pub struct SecretValue {
    // some fields omitted
}

A SecretValue contains a password or other secret value. Use SecretValue::get() to get the actual secret data, such as a password. This library only supports content type text/plain for now.

Methods

impl SecretValue

fn new(secret: &str) -> Self

Create a SecretValue for the secret data passed in. This method will NOT create the actual secret in the backing Secret Service. (see SecretService.store() for that) The secret data is copied into non-pageable 'secure' memory.

fn from_glib_full(ptr: *mut SecretValue) -> Self

Transfer ownership of a raw SecretValue pointer to rust.

fn to_glib_none(&self) -> *mut SecretValue

None-transfer to glib.

fn get(&self) -> Option<String>

Get the secret data in the SecretValue. For now, this method only supports String values. Returns None, if the content type is npt text/plain

fn get_content_type(&self) -> String

Get the content type of the secret value, such as text/plain.

Trait Implementations

impl StaticType for SecretValue

fn static_type() -> Type

impl Clone for SecretValue

fn clone(&self) -> Self

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

impl Drop for SecretValue

fn drop(&mut self)