Struct rejson::SecretsFile

source ·
pub struct SecretsFile { /* private fields */ }

Implementations§

source§

impl SecretsFile

source

pub fn load<P: AsRef<Path>>(path: P) -> Result<Self>

Creates a new [Parser] by reading the specified file.

source

pub fn public_key(&self) -> Option<Key>

Extracts the public key from the JSON object.

source

pub fn transform<F: Transform>(&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.

Trait Implementations§

source§

impl Debug for SecretsFile

source§

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

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

impl Display for SecretsFile

source§

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

Returns the pretty-printed JSON representation.

source§

impl FromStr for SecretsFile

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V