pub struct IoFlags(/* private fields */);Expand description
Flags that can be used with Input, Output, or Feature items.
§Example
let flags = IoFlags::data().variable().null_state();
assert_eq!(u32::from(flags), 0x42);Implementations§
Source§impl IoFlags
impl IoFlags
Sourcepub const fn is_constant(self) -> bool
pub const fn is_constant(self) -> bool
Test if this is a constant field.
Sourcepub const fn variable(self) -> Self
pub const fn variable(self) -> Self
The field stores a variable.
By default fields store an array.
Sourcepub const fn is_variable(self) -> bool
pub const fn is_variable(self) -> bool
Test if this is a variable field.
Sourcepub const fn relative(self) -> Self
pub const fn relative(self) -> Self
The field holds a relative value.
By default values are absolute.
Sourcepub const fn is_relative(self) -> bool
pub const fn is_relative(self) -> bool
Test if this field is relative.
Sourcepub const fn is_absolute(self) -> bool
pub const fn is_absolute(self) -> bool
Test if this field is absolute.
Sourcepub const fn wrap(self) -> Self
pub const fn wrap(self) -> Self
The value wraps around in the positive and negative directions.
By default values do not wrap.
Sourcepub const fn non_linear(self) -> Self
pub const fn non_linear(self) -> Self
The value is non-linear.
By default values are linear.
Sourcepub const fn no_preferred_state(self) -> Self
pub const fn no_preferred_state(self) -> Self
The value has no preferred state.
Preferred state means that a control will return to some state when it’s not being used. Buttons or joysticks are examples of controls with a preferred state.
By default values have a preferred state.
Sourcepub const fn has_preferred_state(self) -> bool
pub const fn has_preferred_state(self) -> bool
Test if this field has a preferred state.
Sourcepub const fn null_state(self) -> Self
pub const fn null_state(self) -> Self
The control has a null state.
A null state is a value outside the logical minimum-maximum range, used to indicate that the control is not active (such as a hat switch).
By default controls have no null position.
Sourcepub const fn has_null_state(self) -> bool
pub const fn has_null_state(self) -> bool
Test if this field has a null state.
Sourcepub const fn volatile(self) -> Self
pub const fn volatile(self) -> Self
The value is volatile.
A volatile value is one that can change without host interaction.
By default a value is non-volatile.
This flag is only used for Output or Feature items.
Sourcepub const fn is_volatile(self) -> bool
pub const fn is_volatile(self) -> bool
Test if this field is volatile.
Sourcepub const fn buffered(self) -> Self
pub const fn buffered(self) -> Self
The value is buffered.
Buffered data is not a single numeric quantity, but instead part of a stream of bytes (for example data from a barcode reader).
By default a value is a bit field.
Sourcepub const fn is_buffered(self) -> bool
pub const fn is_buffered(self) -> bool
Test if this field is buffered.
Sourcepub const fn is_bitfield(self) -> bool
pub const fn is_bitfield(self) -> bool
Test if this field is a bit field.
Trait Implementations§
impl Copy for IoFlags
Source§impl From<IoFlags> for OutputFeatureFlags
impl From<IoFlags> for OutputFeatureFlags
Source§fn from(flags: IoFlags) -> Self
fn from(flags: IoFlags) -> Self
Convert an IoFlags value.
Note that unline InputFlags, all IoFlags values are valid Output or Feature flags.