pub struct KeyboardFeed {
keys: Vec<Key>,
next: usize,
}Expand description
Host text waiting to be typed into a DOS guest.
Fields§
§keys: Vec<Key>Keys still to deliver, in order; the front has not been consumed yet.
next: usizeIndex of the next key to deliver (shared by both consumer views).
Implementations§
Source§impl KeyboardFeed
impl KeyboardFeed
Sourcepub fn from_pending(keys: Vec<Key>) -> Self
pub fn from_pending(keys: Vec<Key>) -> Self
Continues a previous slice from exactly where it stopped.
Whole keys are stored, so a slice hand-over cannot split a make/break pair or replay a key the guest already received.
Sourcepub fn remaining_keys(&self) -> Vec<Key>
pub fn remaining_keys(&self) -> Vec<Key>
Copies the keys a slice hand-over must carry to the next slice.
Sourcepub fn fill(
&mut self,
controller: &mut KeyboardController,
limit: usize,
) -> usize
pub fn fill( &mut self, controller: &mut KeyboardController, limit: usize, ) -> usize
Queues whole keys on the 8042 path; returns how many scancode bytes were accepted.
A key is only started when the controller has room for all of its bytes,
so the guest never sees half of a make/break pair, and limit (a byte
budget) can never split a key either.
Sourcepub fn fill_bios(&mut self, bios: &mut BiosState, limit: usize) -> usize
pub fn fill_bios(&mut self, bios: &mut BiosState, limit: usize) -> usize
Pushes whole keys into the firmware keyboard buffer.
This is the path of a guest that did not install its own INT 9: its
INT 16h calls still reach the firmware model, so the keys have to
appear where that service reads them.
Auto Trait Implementations§
impl Forget for KeyboardFeed
impl Freeze for KeyboardFeed
impl Move for KeyboardFeed
impl RefUnwindSafe for KeyboardFeed
impl Send for KeyboardFeed
impl Sync for KeyboardFeed
impl Unpin for KeyboardFeed
impl UnsafeUnpin for KeyboardFeed
impl UnwindSafe for KeyboardFeed
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more