FakeController

Struct FakeController 

Source
pub struct FakeController {
    pub nibble: u8,
    pub writes: Vec<(bool, bool)>,
}
Expand description

Records SEL/CLR and answers a fixed nibble.

Fields§

§nibble: u8§writes: Vec<(bool, bool)>

Implementations§

Trait Implementations§

Source§

impl ControllerPort for FakeController

Source§

fn write(&mut self, sel: bool, clr: bool)

Source§

fn read(&mut self, _sel: bool, _clr: bool) -> u8

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Source§

fn set_pressed(&mut self, port: usize, pressed: u16)

The host’s side: the buttons held on pad port (0 for a pad plugged straight in, 0-4 behind a multitap), as the bit mask of pads.rs.
Source§

impl DeviceState for FakeController

Source§

fn save_state(&self) -> Vec<u8> ⓘ

Everything of the device that changes as the console runs.
Source§

fn load_state(&mut self, data: &[u8]) -> Result<(), String>

Put the device in a saved state. A device without state accepts only an empty one.
Source§

fn state_identity(&self) -> String

What the device is and which media it holds (a card’s ROM by its SHA-1, a disc by its table of contents): a state is refused by a system whose device answers otherwise.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.