Expand description
This crate creates the abstraction of stdio
. They are essentially ring buffer of bytes.
It also creates the queue for KeyEvent
, which allows applications to have direct access
to keyboard events.
Structs
- A reader to keyevent ring buffer.
- A writer to keyevent ring buffer.
- A structure that allows applications to access keyboard events directly. When it gets instantiated, it
take
s the reader of theKeyEventQueue
away from theshell
, or whichever entity previously owned the queue. When it goes out of the scope, the taken reader will be automatically returned back to theshell
or the original owner in itsDrop
routine. - A ring buffer with an EOF mark.
- A ring buffer containing bytes. It forms
stdin
,stdout
andstderr
. The twoArc
s actually point to the same ring buffer. It is designed to prevent interleaved reading but at the same time allow writing to the ring buffer while the reader is holding its lock, and vice versa. StdioReadGuard
acts likeMutexGuard
, it locks the underlying ring buffer during its lifetime, and provides reading methods to the ring buffer. The lock will be automatically released on dropping of this structure.- A reader to stdio buffers.
StdioReadGuard
acts likeMutexGuard
, it locks the underlying ring buffer during its lifetime, and provides writing methods to the ring buffer. The lock will be automatically released on dropping of this structure.- A writer to stdio buffers.
Type Aliases
- A reference to a ring buffer with an EOF mark with mutex protection.