FieldAttributes

Trait FieldAttributes 

Source
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§

Source

fn is_relative(&self) -> bool

True if the data is relative compared to a previous report

Mutually exclusive with FieldAttributes::is_absolute.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn is_buffered_bytes(&self) -> bool

True if the control emits a fixed size stream of bytes.

Mutually exclusive with FieldAttributes::is_bitfield.

Source

fn is_volatile(&self) -> Option<bool>

Indiciates whether control should be changed by the host. Volatile fields can change without host interactions.

This attribute is only available on a Field in an OutputReport or an FeatureReport. It is always None for fields in an InputReport.

Provided Methods§

Source

fn is_absolute(&self) -> bool

True if the data is absolute

Mutually exclusive with FieldAttributes::is_relative.

Source

fn does_not_wrap(&self) -> bool

True if the data does not wrap at the logical minimum/maximum.

Mutually exclusive with FieldAttributes::wraps.

Source

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.

Source

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.

Source

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.

Source

fn is_bitfield(&self) -> bool

True if the control is a single bit field (value).

Mutually exclusive with FieldAttributes::is_buffered_bytes.

Source

fn is_nonvolatile(&self) -> Option<bool>

Indiciates whether control should be changed by the host. Volatile fields can change without host interactions.

This attribute is only available on a Field in an OutputReport or an FeatureReport. It is always None for fields in an InputReport.

Implementors§