MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / fmt

Method fmt

src/termios/types.rs:214–242  ·  view source on GitHub ↗
(&self, f: &mut core::fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

212
213impl core::fmt::Debug for Termios {
214 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
215 let mut d = f.debug_struct("Termios");
216 d.field("input_modes", &self.input_modes);
217 d.field("output_modes", &self.output_modes);
218
219 // This includes any bits set in the `CBAUD` and `CIBAUD` ranges, which
220 // is a little ugly, because we also decode those bits for the speeds
221 // below. However, it seems better to print them here than to hide
222 // them, because hiding them would make the `Termios` debug output
223 // appear to disagree with the `ControlModes` debug output for the same
224 // value, which could be confusing.
225 d.field("control_modes", &self.control_modes);
226
227 d.field("local_modes", &self.local_modes);
228 #[cfg(any(
229 linux_like,
230 target_env = "newlib",
231 target_os = "fuchsia",
232 target_os = "haiku",
233 target_os = "redox"
234 ))]
235 {
236 d.field("line_discipline", &SpecialCode(self.line_discipline));
237 }
238 d.field("special_codes", &self.special_codes);
239 d.field("input_speed", &self.input_speed());
240 d.field("output_speed", &self.output_speed());
241 d.finish()
242 }
243}
244
245bitflags! {

Callers

nothing calls this directly

Calls 5

SpecialCodeClass · 0.85
SpecialCodeIndexClass · 0.85
input_speedMethod · 0.80
output_speedMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected