Skip to main content

Secrets

Struct Secrets 

Source
pub struct Secrets { /* private fields */ }
Expand description

An engine-scoped store of values readable through {"secret": "name"}.

Always an object; nested objects let a host namespace ({"secret": "partner.hmac"}). It is neither Serialize nor Clone, and its Debug prints key names with every value masked.

Implementations§

Source§

impl Secrets

Source

pub fn new(root: OwnedDataValue) -> Result<Self>

Wraps a host-supplied value. It must be an object, else ErrorKind::Config.

Source

pub fn get(&self, path: &str) -> Option<&OwnedDataValue>

Looks up a dotted path, by a context path’s segment rules. The empty path is None, never the whole store. A lookup allocates nothing.

Source

pub fn names(&self) -> impl Iterator<Item = &str>

Top-level key names. Never values.

Trait Implementations§

Source§

impl Debug for Secrets

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Secrets

Source§

fn default() -> Self

A store with nothing in it: the operator still exists, and every lookup fails.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.