Set the properties of this device.
(self, switches: &AttributeSetRef<PropType>)
| 133 | |
| 134 | /// Set the properties of this device. |
| 135 | pub fn with_properties(self, switches: &AttributeSetRef<PropType>) -> io::Result<Self> { |
| 136 | for bit in switches.iter() { |
| 137 | unsafe { |
| 138 | sys::ui_set_propbit( |
| 139 | self.fd.as_raw_fd(), |
| 140 | bit.0 as nix::sys::ioctl::ioctl_param_type, |
| 141 | )?; |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | Ok(self) |
| 146 | } |
| 147 | |
| 148 | /// Set the switch codes that can be emitted by this device. |
| 149 | pub fn with_switches(self, switches: &AttributeSetRef<SwitchCode>) -> io::Result<Self> { |