pub struct Bus {
pub ram: Memory,
pub console: Console,
pub timer: Timer,
pub block: BlockDevice,
}Expand description
RAM plus the memory-mapped devices.
Addresses at or above zero go to RAM. Addresses inside the device range go to whichever device owns the slot. Addresses below the device range are RAM as well, so the negative half is not reserved wholesale.
Fields§
§ram: MemoryRandom access memory.
console: ConsoleThe console.
timer: TimerThe tick counter.
block: BlockDeviceThe block device.
Implementations§
Trait Implementations§
Source§impl Addressable for Bus
impl Addressable for Bus
Source§fn is_privileged(&self, addr: Word) -> bool
fn is_privileged(&self, addr: Word) -> bool
Device addresses need supervisor privilege; RAM does not.
Source§fn interrupts(&self) -> Word
fn interrupts(&self) -> Word
One trit per source: positive while that device is asserting.
Source§fn write_tryte(&mut self, addr: Word, value: Tryte) -> Result<(), MemoryError>
fn write_tryte(&mut self, addr: Word, value: Tryte) -> Result<(), MemoryError>
Writes one tryte.
Auto Trait Implementations§
impl Freeze for Bus
impl RefUnwindSafe for Bus
impl Send for Bus
impl Sync for Bus
impl Unpin for Bus
impl UnsafeUnpin for Bus
impl UnwindSafe for Bus
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