[−][src]Struct libmodbus::Timeout
Timeout struct
- The value of usec argument must be in the range 0 to 999999.
Fields
sec: u32
usec: 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 ofTimeout
usec
-usec
part ofTimeout
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 ofTimeout
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 ofTimeout
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,