Struct libftd2xx::Version[][src]

pub struct Version {
    pub major: u8,
    pub minor: u8,
    pub build: u8,
}

D2XX version structure.

Note this is not a SemVer. SemVer defines the last number as the patch number, whereas FTDI uses it as a build number.

This is returned by library_version and driver_version.

Fields

major: u8

Major version.

minor: u8

Minor version.

build: u8

Build number.

Implementations

impl Version[src]

pub const fn new(major: u8, minor: u8, build: u8) -> Version[src]

Create a new version structure from decimal values.

Example

use libftd2xx::Version;

let version = Version::new(3, 1, 15);
assert_eq!(
    version,
    Version {
        major: 3,
        minor: 1,
        build: 15
    }
);

pub fn with_bcd(major: u8, minor: u8, build: u8) -> Version[src]

Create a new version structure from binary-coded decimal (BCD) values.

Example

use libftd2xx::Version;

let version = Version::with_bcd(0x03, 0x01, 0x15);
assert_eq!(version, Version::new(3, 1, 15));

pub fn with_raw(value: u32) -> Version[src]

Create a new version structure from the raw C-API value.

Example

use libftd2xx::Version;

let version = Version::with_raw(0x00030115);
assert_eq!(version, Version::new(3, 1, 15));

Trait Implementations

impl Clone for Version[src]

impl Copy for Version[src]

impl Debug for Version[src]

impl Display for Version[src]

impl Eq for Version[src]

impl Ord for Version[src]

impl PartialEq<Version> for Version[src]

impl PartialOrd<Version> for Version[src]

impl StructuralEq for Version[src]

impl StructuralPartialEq for Version[src]

Auto Trait Implementations

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> ToString for T where
    T: Display + ?Sized
[src]

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.