pub enum PropertyValue {
Int8(i8),
Uint8(u8),
Int16(i16),
Uint16(u16),
Int32(i32),
Uint32(u32),
Int64(i64),
Uint64(u64),
String(String),
}Expand description
A property value with its associated type.
Used for device property values in DevicePropDesc, as well as
for get/set device property operations.
Variants§
Int8(i8)
Signed 8-bit integer.
Uint8(u8)
Unsigned 8-bit integer.
Int16(i16)
Signed 16-bit integer.
Uint16(u16)
Unsigned 16-bit integer.
Int32(i32)
Signed 32-bit integer.
Uint32(u32)
Unsigned 32-bit integer.
Int64(i64)
Signed 64-bit integer.
Uint64(u64)
Unsigned 64-bit integer.
String(String)
UTF-16LE encoded string.
Implementations§
Source§impl PropertyValue
impl PropertyValue
Sourcepub fn from_bytes(
buf: &[u8],
data_type: PropertyDataType,
) -> Result<(Self, usize), Error>
pub fn from_bytes( buf: &[u8], data_type: PropertyDataType, ) -> Result<(Self, usize), Error>
Parse a property value from bytes given the expected data type.
Returns the parsed value and the number of bytes consumed.
Sourcepub fn data_type(&self) -> PropertyDataType
pub fn data_type(&self) -> PropertyDataType
Get the data type of this property value.
Trait Implementations§
Source§impl Clone for PropertyValue
impl Clone for PropertyValue
Source§fn clone(&self) -> PropertyValue
fn clone(&self) -> PropertyValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PropertyValue
impl Debug for PropertyValue
Source§impl PartialEq for PropertyValue
impl PartialEq for PropertyValue
impl StructuralPartialEq for PropertyValue
Auto Trait Implementations§
impl Freeze for PropertyValue
impl RefUnwindSafe for PropertyValue
impl Send for PropertyValue
impl Sync for PropertyValue
impl Unpin for PropertyValue
impl UnsafeUnpin for PropertyValue
impl UnwindSafe for PropertyValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more