Lines Matching refs:Pattern
78 pub enum Pattern { enum
115 impl ToString for Pattern { implementation
118 Pattern::Help => "help".to_string(), in to_string()
119 Pattern::Version => "version".to_string(), in to_string()
120 Pattern::System => "system".to_string(), in to_string()
121 Pattern::Host(s) => format!("{}={}", "host".to_string(), s), in to_string()
122 Pattern::Machine(s) => format!("{}={}", "machine".to_string(), s), in to_string()
123 Pattern::Type(t) => format!("{}={:?}", "type".to_string(), t), in to_string()
124 Pattern::State(s) => format!("{}={:?}", "state".to_string(), s), in to_string()
125 Pattern::Property(s) => format!("{}={}", "property".to_string(), s), in to_string()
126 Pattern::All => "all".to_string(), in to_string()
127 Pattern::Full => "full".to_string(), in to_string()
128 Pattern::Recursive => "recursive".to_string(), in to_string()
129 Pattern::Reverse => "reverse".to_string(), in to_string()
130 Pattern::JobMode(s) => format!("{}={}", "job-mode".to_string(), s), in to_string()
131 Pattern::ShowTypes => "show-types".to_string(), in to_string()
132 Pattern::IgnoreInhibitors => "ignore-inhibitors".to_string(), in to_string()
133 Pattern::KillWho(s) => format!("{}={}", "kill-who".to_string(), s), in to_string()
134 Pattern::Signal(s) => format!("{}={}", "signal".to_string(), s), in to_string()
135 Pattern::Now => "now".to_string(), in to_string()
136 Pattern::Quiet => "quiet".to_string(), in to_string()
137 Pattern::NoBlock => "no-block".to_string(), in to_string()
138 Pattern::NoWall => "no-wall".to_string(), in to_string()
139 Pattern::NoReload => "no-reload".to_string(), in to_string()
140 Pattern::NoLegend => "no-legend".to_string(), in to_string()
141 Pattern::NoPaper => "no-paper".to_string(), in to_string()
142 Pattern::NoAskPassword => "no-ask-password".to_string(), in to_string()
143 Pattern::Global => "global".to_string(), in to_string()
144 Pattern::Runtime => "runtime".to_string(), in to_string()
145 Pattern::Force => "force".to_string(), in to_string()
146 Pattern::PresetMode => "preset-mode".to_string(), in to_string()
147 Pattern::Root(s) => format!("{}={}", "root".to_string(), s), in to_string()
148 Pattern::Lines(i) => format!("{}={}", "lines".to_string(), i), in to_string()
149 Pattern::Output(s) => format!("{}={}", "output".to_string(), s), in to_string()
150 Pattern::Plain => "plain".to_string(), in to_string()
151 Pattern::None => "none".to_string(), in to_string()
224 pub static ref CTL_PATTERN: HashMap<&'static str, Pattern> = {
226 map.insert("help", Pattern::Help);
227 map.insert("version", Pattern::Version);
228 map.insert("system", Pattern::System);
229 map.insert("host", Pattern::Host(String::new()));
230 map.insert("machine", Pattern::Machine(String::new()));
231 map.insert("type", Pattern::Type(UnitType::Unknown));
232 map.insert("state", Pattern::State(UnitState::Active));
233 map.insert("property", Pattern::Property(String::new()));
234 map.insert("all", Pattern::All);
235 map.insert("full", Pattern::Full);
236 map.insert("recursive", Pattern::Recursive);
237 map.insert("reverse", Pattern::Reverse);
238 map.insert("job-mode", Pattern::JobMode(String::new()));
239 map.insert("show-types", Pattern::ShowTypes);
240 map.insert("ignore-inhibitors", Pattern::IgnoreInhibitors);
241 map.insert("kill-who", Pattern::KillWho(String::new()));
242 map.insert("signal", Pattern::Signal(String::new()));
243 map.insert("now", Pattern::Now);
244 map.insert("quiet", Pattern::Quiet);
245 map.insert("no-block", Pattern::NoBlock);
246 map.insert("no-wall", Pattern::NoWall);
247 map.insert("no-reload", Pattern::NoReload);
248 map.insert("no-legend", Pattern::NoLegend);
249 map.insert("no-paper", Pattern::NoPaper);
250 map.insert("no-ask-password", Pattern::NoAskPassword);
251 map.insert("global", Pattern::Global);
252 map.insert("runtime", Pattern::Runtime);
253 map.insert("force", Pattern::Force);
254 map.insert("preset-mode", Pattern::PresetMode);
255 map.insert("root", Pattern::Root(String::new()));
256 map.insert("lines", Pattern::Lines(-1));
257 map.insert("output", Pattern::Output(String::new()));
258 map.insert("plain", Pattern::Plain);
337 fn parse_pattern(s: &str) -> Result<Pattern, ParseError> { in parse_pattern() argument
338 let pattern: Pattern; in parse_pattern()
348 Pattern::Host(_) => Pattern::Host(words[1].to_string()), in parse_pattern()
349 Pattern::Machine(_) => Pattern::Machine(words[1].to_string()), in parse_pattern()
350 Pattern::Type(_) => Pattern::Type(UnitParseUtil::parse_type(words[1])), in parse_pattern()
351 Pattern::State(_) => { in parse_pattern()
354 Pattern::JobMode(_) => Pattern::JobMode(words[1].to_string()), in parse_pattern()
355 Pattern::KillWho(_) => Pattern::KillWho(words[1].to_string()), in parse_pattern()
356 Pattern::Lines(_) => match words[1].parse::<i32>() { in parse_pattern()
357 Ok(val) => Pattern::Lines(val), in parse_pattern()
362 Pattern::Output(_) => Pattern::Output(words[1].to_string()), in parse_pattern()
363 Pattern::Property(_) => Pattern::Property(words[1].to_string()), in parse_pattern()
364 Pattern::Root(_) => Pattern::Root(words[1].to_string()), in parse_pattern()
365 Pattern::Signal(_) => Pattern::Signal(words[1].to_string()), in parse_pattern()