pub struct SecretsFile { /* private fields */ }Implementations§
Source§impl SecretsFile
impl SecretsFile
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
Creates a new SecretsFile by reading the specified file.
Sourcepub fn public_key(&self) -> Option<Key>
pub fn public_key(&self) -> Option<Key>
Extracts the public key from the JSON object.
Sourcepub fn transform<F: Fn(String) -> Result<String>>(
&mut self,
transformer: F,
) -> Result<()>
pub fn transform<F: Fn(String) -> Result<String>>( &mut self, transformer: F, ) -> Result<()>
Performs the supplied transformation function on each eligible value in the document. Eligible in this case refers to string values who’s key does not start with an underscore.
The transformer will be called for each eligible string value and is expected to return a new value to be used in it’s place.
This function transforms the values in place by mutating the underlying structure.
Sourcepub fn children(&self, root_key: &str) -> Option<HashMap<&str, &str>>
pub fn children(&self, root_key: &str) -> Option<HashMap<&str, &str>>
Returns a map of all direct children of the supplied key with scalar values.
Sourcepub fn without_public_key(&self) -> Self
pub fn without_public_key(&self) -> Self
Returns a new SecretsFile that is a clone of this one without the _public_key field.
Trait Implementations§
Source§impl Debug for SecretsFile
impl Debug for SecretsFile
Source§impl Display for SecretsFile
impl Display for SecretsFile
Auto Trait Implementations§
impl Freeze for SecretsFile
impl RefUnwindSafe for SecretsFile
impl Send for SecretsFile
impl Sync for SecretsFile
impl Unpin for SecretsFile
impl UnwindSafe for SecretsFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more