[][src]Function termios::cfsetspeed

pub fn cfsetspeed(termios: &mut Termios, speed: speed_t) -> Result<()>

Sets input and output baud rates.

This function only sets the necessary values on the given Termios structure. The settings are applied on a successful call to tcsetattr().

Parameters

  • termios should be a mutable reference to a Termios structure.
  • speed should be one of the baud rate constants:
    • B0
    • B50
    • B75
    • B110
    • B134
    • B150
    • B200
    • B300
    • B600
    • B1200
    • B1800
    • B2400
    • B4800
    • B9600
    • B19200
    • B38400
    • any OS-specific baud rate defined in termios::os.

Examples

cfsetspeed(&mut termios, B9600).unwrap();
assert_eq!(cfgetispeed(&termios), B9600);
assert_eq!(cfgetospeed(&termios), B9600);

Portability

This function is not part of the IEEE Std 1003.1 ("POSIX.1") specification, but it is available on Linux, BSD, and OS X.