MCPcopy Create free account
hub / github.com/emberian/evdev / with_properties

Method with_properties

src/uinput.rs:135–146  ·  view source on GitHub ↗

Set the properties of this device.

(self, switches: &AttributeSetRef<PropType>)

Source from the content-addressed store, hash-verified

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> {

Callers

nothing calls this directly

Calls 2

iterMethod · 0.80
as_raw_fdMethod · 0.45

Tested by

no test coverage detected