Struct libmodbus_rs::Timeout
[−]
[src]
pub struct Timeout { pub sec: u32, pub usec: u32, }
Timeout struct
- The value of usec argument must be in the range 0 to 999999.
Fields
sec: u32
usec: u32
Methods
impl Timeout
[src]
Timeout
implementation
pub fn new(sec: u32, usec: u32) -> Self
[src]
Create a new Timeout
struct from sec
and usec
parameters given
Parameters
sec
-sec
part ofTimeout
usec
-usec
part ofTimeout
Examples
use libmodbus_rs::{Modbus, Timeout}; assert_eq!(Timeout::new(1, 2), Timeout { sec: 1, usec: 2 });
pub fn new_sec(sec: u32) -> Self
[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 ofTimeout
Examples
use libmodbus_rs::{Modbus, Timeout}; assert_eq!(Timeout::new_sec(1), Timeout { sec: 1, usec: 0 });
pub fn new_usec(usec: u32) -> Self
[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 ofTimeout
Examples
use libmodbus_rs::{Modbus, Timeout}; assert_eq!(Timeout::new_usec(2), Timeout { sec: 0, usec: 2 });
Trait Implementations
impl Debug for Timeout
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Timeout
[src]
fn clone(&self) -> Timeout
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Timeout
[src]
impl PartialEq for Timeout
[src]
fn eq(&self, __arg_0: &Timeout) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Timeout) -> bool
[src]
This method tests for !=
.
impl Eq for Timeout
[src]
impl Default for Timeout
[src]
Default Iimeout
, all members set to zero