pub trait FieldAttributes {
Show 14 methods
// Required methods
fn is_relative(&self) -> bool;
fn wraps(&self) -> bool;
fn is_nonlinear(&self) -> bool;
fn has_no_preferred_state(&self) -> bool;
fn has_null_state(&self) -> bool;
fn is_buffered_bytes(&self) -> bool;
fn is_volatile(&self) -> Option<bool>;
// Provided methods
fn is_absolute(&self) -> bool { ... }
fn does_not_wrap(&self) -> bool { ... }
fn is_linear(&self) -> bool { ... }
fn has_preferred_state(&self) -> bool { ... }
fn has_no_null_state(&self) -> bool { ... }
fn is_bitfield(&self) -> bool { ... }
fn is_nonvolatile(&self) -> Option<bool> { ... }
}Expand description
Field attributes, see Main Data Item in Section 6.2.5.
These properties come in pairs (bit set or unset in the HID report descriptor item), for readability in the caller, a function is provided for each state.
Required Methods§
Sourcefn is_relative(&self) -> bool
fn is_relative(&self) -> bool
True if the data is relative compared to a previous report
Mutually exclusive with FieldAttributes::is_absolute.
Sourcefn wraps(&self) -> bool
fn wraps(&self) -> bool
True if the data wraps around at the logical minimum/maximum (e.g. a dial that can spin at 360 degrees).
Mutually exclusive with FieldAttributes::does_not_wrap.
Sourcefn is_nonlinear(&self) -> bool
fn is_nonlinear(&self) -> bool
True if the data was pre-processed on the device and the logical range is not linear.
Mutually exclusive with FieldAttributes::is_linear.
Sourcefn has_no_preferred_state(&self) -> bool
fn has_no_preferred_state(&self) -> bool
True if the control does not have a preferred state it returns to when the user stops interacting (e.g. a joystick may return to a neutral position)
Mutually exclusive with FieldAttributes::has_preferred_state.
Sourcefn has_null_state(&self) -> bool
fn has_null_state(&self) -> bool
True if the control has a null state where it does not send data (e.g. a joystick in neutral state)
Mutually exclusive with FieldAttributes::has_no_null_state.
Sourcefn is_buffered_bytes(&self) -> bool
fn is_buffered_bytes(&self) -> bool
True if the control emits a fixed size stream of bytes.
Mutually exclusive with FieldAttributes::is_bitfield.
Provided Methods§
Sourcefn is_absolute(&self) -> bool
fn is_absolute(&self) -> bool
True if the data is absolute
Mutually exclusive with FieldAttributes::is_relative.
Sourcefn does_not_wrap(&self) -> bool
fn does_not_wrap(&self) -> bool
True if the data does not wrap at the logical minimum/maximum.
Mutually exclusive with FieldAttributes::wraps.
Sourcefn is_linear(&self) -> bool
fn is_linear(&self) -> bool
True if the data was not pre-processed on the device and the logical range is linear.
Mutually exclusive with FieldAttributes::is_nonlinear.
Sourcefn has_preferred_state(&self) -> bool
fn has_preferred_state(&self) -> bool
True if the control has a preferred state it returns to when the user stops interacting (e.g. a joystick may return to a neutral position)
Mutually exclusive with FieldAttributes::has_no_preferred_state.
Sourcefn has_no_null_state(&self) -> bool
fn has_no_null_state(&self) -> bool
True if the control does not have a null state where it does not send data.
Mutually exclusive with FieldAttributes::has_null_state.
Sourcefn is_bitfield(&self) -> bool
fn is_bitfield(&self) -> bool
True if the control is a single bit field (value).
Mutually exclusive with FieldAttributes::is_buffered_bytes.