pub enum ValueSource {
Literal(String),
Env(String),
File {
path: PathBuf,
dot_path: String,
format: Option<String>,
},
Stdin,
Fd(i32),
Prompt,
Host {
scheme: String,
value: String,
},
}Expand description
Where one value is, decided at parse time and read on demand.
Variants§
Literal(String)
Env(String)
File
Fields
Stdin
Fd(i32)
Prompt
Host
A scheme the host declared and reads itself.
Implementations§
Source§impl ValueSource
impl ValueSource
Sourcepub fn read(&self) -> Result<String, SourceError>
pub fn read(&self) -> Result<String, SourceError>
Read the value.
Errors may quote the file and the parser’s complaint: for an ordinary value, saying what was wrong with it is the whole point of the error. A scalar that is not a string — a port, a boolean — is rendered in its canonical spelling; a collection is refused.
Sourcepub fn read_secret(&self) -> Result<SecretString, SourceError>
pub fn read_secret(&self) -> Result<SecretString, SourceError>
Read the value as a secret.
The result cannot be printed without SecretString::expose_secret,
errors carry nothing that could echo what was read, and a non-string
value is refused rather than coerced.
Trait Implementations§
Source§impl Clone for ValueSource
impl Clone for ValueSource
Source§fn clone(&self) -> ValueSource
fn clone(&self) -> ValueSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValueSource
impl Debug for ValueSource
impl Eq for ValueSource
Source§impl PartialEq for ValueSource
impl PartialEq for ValueSource
impl StructuralPartialEq for ValueSource
Auto Trait Implementations§
impl Freeze for ValueSource
impl RefUnwindSafe for ValueSource
impl Send for ValueSource
impl Sync for ValueSource
impl Unpin for ValueSource
impl UnsafeUnpin for ValueSource
impl UnwindSafe for ValueSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.