pub struct NativeEvent { /* private fields */ }Expand description
kr_event: one key or command, read by value; len counts the UTF-16 units in use.
Implementations§
Source§impl NativeEvent
impl NativeEvent
Sourcepub fn new(
role: u32,
mode: u32,
context: u32,
units: &[u16],
) -> Result<Self, u32>
pub fn new( role: u32, mode: u32, context: u32, units: &[u16], ) -> Result<Self, u32>
Copy a bounded wire event using the tags defined in include/keyrill.h.
The engine validates tags when planning. Native key translation may represent an unmapped layout with mode zero, which the engine refuses.
§Errors
Returns the C ABI bounds status when the input exceeds eight UTF-16 units.
let event = keyrill_ffi::NativeEvent::new(1, 1, 0, &[b'g' as u16]);
assert!(event.is_ok());Trait Implementations§
Source§impl Clone for NativeEvent
impl Clone for NativeEvent
Source§fn clone(&self) -> NativeEvent
fn clone(&self) -> NativeEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NativeEvent
Auto Trait Implementations§
impl Freeze for NativeEvent
impl RefUnwindSafe for NativeEvent
impl Send for NativeEvent
impl Sync for NativeEvent
impl Unpin for NativeEvent
impl UnsafeUnpin for NativeEvent
impl UnwindSafe for NativeEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more