pub enum Value {
    Bool(bool),
    Int(i32),
    Flt(f64),
    Str(String),
}
Expand description

Defines fundamental types that can be associated with a device. Drivers set the type for each device they manage and, for devices that can be set, only accept values of the correct type.

Variants§

§

Bool(bool)

For devices that return/accept a simple true/false, on/off, etc., state.

§

Int(i32)

For devices that return/accept an integer value. It is stored as a signed, 32-bit.

§

Flt(f64)

For devices that return/accept floating point numbers.

§

Str(String)

For devices that return/accept text. Since strings can greatly vary in size, care must be taken when returning this type. A driver that returns strings rapidly should keep them short. Longer strings should be returned at a slower rate. If the system takes too much time serializing string data, it could throw other portions of DrMem out of “soft real-time”.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.