pub struct CmdLine {
name: String,
contents: Vec<String>,
}Expand description
A CmdLine holds a set of command-line arguments that augment a configuration.
These arguments are formatted in toml, and concatenated into a single toml object. With arguments of the form “key=bareword”, the bareword is quoted for convenience.
Fields§
§name: StringString for decorating Values.
contents: Vec<String>List of toml lines as given on the command line.
Implementations§
Source§impl CmdLine
impl CmdLine
Sourcepub fn push_toml_line(&mut self, line: String)
pub fn push_toml_line(&mut self, line: String)
Add a single line of toml to the configuration.
Sourcefn convert_toml_error(
&self,
toml_str: &str,
error_message: &str,
span: &Option<Range<usize>>,
) -> String
fn convert_toml_error( &self, toml_str: &str, error_message: &str, span: &Option<Range<usize>>, ) -> String
Try to adjust the contents of a toml deserialization error so that instead it refers to a single command-line argument.
Sourcefn build_toml(&self) -> String
fn build_toml(&self) -> String
Compose elements of this cmdline into a single toml string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CmdLine
impl RefUnwindSafe for CmdLine
impl Send for CmdLine
impl Sync for CmdLine
impl Unpin for CmdLine
impl UnsafeUnpin for CmdLine
impl UnwindSafe for CmdLine
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more