pub enum DeviceBackend<M = FakeMmio, G = FakeGpio, I = FakeI2c, S = FakeSpi, C = FakeClock, R = FakeReset, U = FakeSerial> {
Mmio(M),
Gpio(G),
I2c(I),
Spi(S),
Clock(C),
Reset(R),
Serial(U),
}Expand description
Unified enum backend allowing heterogeneous resources to coexist in one proxy instance.
Variants§
Implementations§
Source§impl<M, G, I, S, C, R, U> DeviceBackend<M, G, I, S, C, R, U>
impl<M, G, I, S, C, R, U> DeviceBackend<M, G, I, S, C, R, U>
Trait Implementations§
Source§impl<M: Clone, G: Clone, I: Clone, S: Clone, C: Clone, R: Clone, U: Clone> Clone for DeviceBackend<M, G, I, S, C, R, U>
impl<M: Clone, G: Clone, I: Clone, S: Clone, C: Clone, R: Clone, U: Clone> Clone for DeviceBackend<M, G, I, S, C, R, U>
Source§impl<M: Debug, G: Debug, I: Debug, S: Debug, C: Debug, R: Debug, U: Debug> Debug for DeviceBackend<M, G, I, S, C, R, U>
impl<M: Debug, G: Debug, I: Debug, S: Debug, C: Debug, R: Debug, U: Debug> Debug for DeviceBackend<M, G, I, S, C, R, U>
Source§impl<M: ResourceBackend, G: ResourceBackend, I: ResourceBackend, S: ResourceBackend, C: ResourceBackend, R: ResourceBackend, U: ResourceBackend> ResourceBackend for DeviceBackend<M, G, I, S, C, R, U>
impl<M: ResourceBackend, G: ResourceBackend, I: ResourceBackend, S: ResourceBackend, C: ResourceBackend, R: ResourceBackend, U: ResourceBackend> ResourceBackend for DeviceBackend<M, G, I, S, C, R, U>
fn read32(&mut self, offset: u64) -> Result<u32, BackendError>
fn write32(&mut self, offset: u64, value: u32) -> Result<(), BackendError>
fn barrier(&mut self)
fn gpio_read(&mut self) -> Result<bool, BackendError>
fn gpio_write(&mut self, value: bool) -> Result<(), BackendError>
fn i2c_transfer( &mut self, write_data: &[u8], read_length: usize, ) -> Result<Vec<u8>, BackendError>
fn spi_transmit(&mut self, tx_data: &[u8]) -> Result<Vec<u8>, BackendError>
fn clock_enable(&mut self) -> Result<(), BackendError>
fn clock_disable(&mut self) -> Result<(), BackendError>
fn clock_is_enabled(&mut self) -> Result<bool, BackendError>
fn clock_set_rate(&mut self, hz: u64) -> Result<(), BackendError>
fn clock_query_rate(&mut self, hz_in: u64) -> Result<u64, BackendError>
fn clock_get_rate(&mut self) -> Result<u64, BackendError>
fn reset_assert(&mut self) -> Result<(), BackendError>
fn reset_deassert(&mut self) -> Result<(), BackendError>
fn reset_toggle(&mut self) -> Result<(), BackendError>
fn reset_status(&mut self) -> Result<bool, BackendError>
fn serial_read(&mut self) -> Result<Vec<u8>, BackendError>
fn serial_write(&mut self, data: &[u8]) -> Result<(), BackendError>
Auto Trait Implementations§
impl<M, G, I, S, C, R, U> Freeze for DeviceBackend<M, G, I, S, C, R, U>
impl<M, G, I, S, C, R, U> RefUnwindSafe for DeviceBackend<M, G, I, S, C, R, U>where
M: RefUnwindSafe,
G: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
C: RefUnwindSafe,
R: RefUnwindSafe,
U: RefUnwindSafe,
impl<M, G, I, S, C, R, U> Send for DeviceBackend<M, G, I, S, C, R, U>
impl<M, G, I, S, C, R, U> Sync for DeviceBackend<M, G, I, S, C, R, U>
impl<M, G, I, S, C, R, U> Unpin for DeviceBackend<M, G, I, S, C, R, U>
impl<M, G, I, S, C, R, U> UnsafeUnpin for DeviceBackend<M, G, I, S, C, R, U>where
M: UnsafeUnpin,
G: UnsafeUnpin,
I: UnsafeUnpin,
S: UnsafeUnpin,
C: UnsafeUnpin,
R: UnsafeUnpin,
U: UnsafeUnpin,
impl<M, G, I, S, C, R, U> UnwindSafe for DeviceBackend<M, G, I, S, C, R, U>where
M: UnwindSafe,
G: UnwindSafe,
I: UnwindSafe,
S: UnwindSafe,
C: UnwindSafe,
R: UnwindSafe,
U: UnwindSafe,
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