SecretTarget

Trait SecretTarget 

Source
pub trait SecretTarget {
    // Required methods
    fn get_secret(&self, key: &str) -> Option<&str>;
    fn insert_secret(&mut self, key: &str, value: &str);
    fn remove_secret(&mut self, key: &str);
}
Expand description

The Secret trait defines methods for managing secret data associated with a Target struct.

Required Methods§

Source

fn get_secret(&self, key: &str) -> Option<&str>

Retrieves the value associated with the given key.

§Parameters
  • key: A string slice representing the key.
§Returns
  • Option<&str>: An optional reference to the value if found; None otherwise.
Source

fn insert_secret(&mut self, key: &str, value: &str)

Inserts a new key-value pair into the secrets.

§Parameters
  • key: A string slice representing the key.
  • value: A string slice representing the value.
Source

fn remove_secret(&mut self, key: &str)

Removes the key-value pair associated with the given key.

§Parameters
  • key: A string slice representing the key.

Implementors§