1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
//! # BlockDevice trait //! ```rust //! pub trait BlockDevice { //! type Error; //! fn read(&self, buf: &mut [u8], address: u32, number_of_blocks: u32) -> Result<(), Self::Error>; //! fn write(&self, buf: &[u8], address: u32, number_of_blocks: u32) -> Result<(), Self::Error>; //! } //! ``` #![no_std] /// BlockDevice trait pub trait BlockDevice { type Error; fn read(&self, buf: &mut [u8], address: u32, number_of_blocks: u32) -> Result<(), Self::Error>; fn write(&self, buf: &[u8], address: u32, number_of_blocks: u32) -> Result<(), Self::Error>; }