Struct tor_config::cmdline::CmdLine
source · 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: String
String 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 UnwindSafe for CmdLine
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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