Struct libmodbus_rs::Timeout [] [src]

pub struct Timeout {
    pub sec: u32,
    pub usec: u32,
}

Timeout struct

Fields

Methods

impl Timeout
[src]

Timeout implementation

[src]

Create a new Timeout struct from sec and usec parameters given

Parameters

  • sec - sec part of Timeout
  • usec - usec part of Timeout

Examples

use libmodbus_rs::{Modbus, Timeout};

assert_eq!(Timeout::new(1, 2), Timeout { sec: 1, usec: 2 });

[src]

Create a new Timeout struct from sec parameter given

The usec parameter is set by the Default implementation of Timeout.

Parameters

  • sec - sec part of Timeout

Examples

use libmodbus_rs::{Modbus, Timeout};

assert_eq!(Timeout::new_sec(1), Timeout { sec: 1, usec: 0 });

[src]

Create a new Timeout struct from usec parameter given

The sec parameter is set by the Default implementation of Timeout.

Parameters

  • usec - usec part of Timeout

Examples

use libmodbus_rs::{Modbus, Timeout};

assert_eq!(Timeout::new_usec(2), Timeout { sec: 0, usec: 2 });

Trait Implementations

impl Debug for Timeout
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Timeout
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Timeout
[src]

impl PartialEq for Timeout
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Timeout
[src]

impl Default for Timeout
[src]

Default Iimeout, all members set to zero

[src]

Returns the "default value" for a type. Read more