[][src]Struct libmodbus::Timeout

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: u32usec: u32

Implementations

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 of Timeout
  • usec - usec part of Timeout

Examples

use libmodbus::{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 of Timeout

Examples

use libmodbus::{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 of Timeout

Examples

use libmodbus::{Modbus, Timeout};

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

Trait Implementations

impl Clone for Timeout[src]

impl Copy for Timeout[src]

impl Debug for Timeout[src]

impl Default for Timeout[src]

Default Iimeout, all members set to zero

impl Eq for Timeout[src]

impl PartialEq<Timeout> for Timeout[src]

impl StructuralEq for Timeout[src]

impl StructuralPartialEq for Timeout[src]

Auto Trait Implementations

impl RefUnwindSafe for Timeout

impl Send for Timeout

impl Sync for Timeout

impl Unpin for Timeout

impl UnwindSafe for Timeout

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,