Commit graph

2 commits

Author SHA1 Message Date
Noah 3581aa25e0
Syncing impl (#36)
* WIP syncing impl

* Finish up syncing impl

* Reorganize synchronization code + add more docs

* Wrap libc::input_id

* Remove thread::sleep used for testing

* Make EventStream::Item io::Result<InputEvent>

* Add RawDevice::empty_state()

* Update Device rustdoc

* Make raw/sync_stream naming consistent

* Update crate docs

* Fix missing first event of block

* Owned AttributeSet, borrowed AttributeSetRef

* Add some basic syncing tests

* Add some more syncing tests
2021-03-16 20:38:42 -06:00
Jeff Hiner cb2f5ef87a
Separate out sane blocking and async (nonblocking) implementations (#33)
* Default impl should block. Renaming it to avoid API confusion from previous users.

* Can't get rid of libc::read because we have MaybeUninit, but we can clean up the match

* Remove extra include

* Switch everything over to io::Error

* Add initial tokio impl+example

* Move evtest_tokio to normal example

* Add documentation and clarify

* Use a VecDeque (ring buffer) instead of repeatedly popping things off the front of a Vec

* Looks like we are not using thiserror anymore; removing

* Store read buf between calls

* Add nonblocking example with epoll

Co-authored-by: Jeff Hiner <jeff-hiner@users.noreply.github.com>
Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-03-01 10:09:11 -07:00