Struct cranelift_reader::TestCommand
source · pub struct TestCommand<'a> {
pub command: &'a str,
pub options: Vec<TestOption<'a>>,
}
Expand description
A command appearing in a test file.
Fields§
§command: &'a str
The command name as a string.
options: Vec<TestOption<'a>>
The options following the command name.
Implementations§
source§impl<'a> TestCommand<'a>
impl<'a> TestCommand<'a>
sourcepub fn new(s: &'a str) -> Self
pub fn new(s: &'a str) -> Self
Create a new TestCommand by parsing s
.
The returned command contains references into s
.
Examples found in repository?
src/parser.rs (line 1077)
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089
pub fn parse_cmdline_passes(&mut self, passes: &'a [String]) -> Vec<TestCommand<'a>> {
let mut list = Vec::new();
for pass in passes {
list.push(TestCommand::new(pass));
}
list
}
/// Parse a list of test commands.
pub fn parse_test_commands(&mut self) -> Vec<TestCommand<'a>> {
let mut list = Vec::new();
while self.token() == Some(Token::Identifier("test")) {
list.push(TestCommand::new(self.consume_line()));
}
list
}
Trait Implementations§
source§impl<'a> Clone for TestCommand<'a>
impl<'a> Clone for TestCommand<'a>
source§fn clone(&self) -> TestCommand<'a>
fn clone(&self) -> TestCommand<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for TestCommand<'a>
impl<'a> Debug for TestCommand<'a>
source§impl<'a> Display for TestCommand<'a>
impl<'a> Display for TestCommand<'a>
source§impl<'a> PartialEq<TestCommand<'a>> for TestCommand<'a>
impl<'a> PartialEq<TestCommand<'a>> for TestCommand<'a>
source§fn eq(&self, other: &TestCommand<'a>) -> bool
fn eq(&self, other: &TestCommand<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Eq for TestCommand<'a>
impl<'a> StructuralEq for TestCommand<'a>
impl<'a> StructuralPartialEq for TestCommand<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for TestCommand<'a>
impl<'a> Send for TestCommand<'a>
impl<'a> Sync for TestCommand<'a>
impl<'a> Unpin for TestCommand<'a>
impl<'a> UnwindSafe for TestCommand<'a>
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.