pub struct CompileCommandSelector {
pub file: String,
pub directory: Option<String>,
pub arguments: Vec<String>,
}Expand description
One stable, exact selector for an entry in compile_commands.json.
The path is the entry’s source after resolving it against directory; the
command remains one argument per element so quoting cannot alter its
meaning between the scanner and helper. Together they name one database
entry without relying on its position in a generated file.
Fields§
§file: StringThe translation-unit source path.
directory: Option<String>The command’s working directory, when the database recorded one.
arguments: Vec<String>The recorded compiler invocation, including its compiler and source.
Implementations§
Source§impl CompileCommandSelector
impl CompileCommandSelector
Sourcepub fn names_the_same_entry(&self, other: &Self) -> bool
pub fn names_the_same_entry(&self, other: &Self) -> bool
Whether this and other name one entry of one compilation database.
Not derived equality, because the two are built by two programs out of one database and their paths are two resolvings of one file. Those are compared as paths, and past a Windows verbatim prefix that only one of the two need have come back carrying — where they are compared as strings instead, no entry matches any request and every unit of a C or C++ project comes back with no build information.
The arguments are compared exactly: they are the words the database recorded, which neither side resolved and neither side may reword.
Trait Implementations§
Source§impl Clone for CompileCommandSelector
impl Clone for CompileCommandSelector
Source§fn clone(&self) -> CompileCommandSelector
fn clone(&self) -> CompileCommandSelector
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more