pub fn read(&self, addr: u64, data: &mut [u8]) -> Result<()> {
        if let Some((base, offset, dev)) = self.resolve(addr) {
            // OK to unwrap as lock() failing is a serious error condition and should panic.
            dev.lock()
                .expect("Failed to acquire device lock")
                .read(base, offset, data);
            Ok(())
        } else {
            Err(Error::MissingAddressRange)
        }
    }
/// Reads data from the device that owns the range containing `addr` and puts it into `data`.
///
/// Returns true on success, otherwise `data` is untouched.
Reads data from the device that owns the range containing `addr` and puts it into `data`.
Returns true on success, otherwise `data` is untouched.
Reads data from the device that owns the range containing ` addr ` and puts it into ` data ` . Returns true on success otherwise ` data ` is untouched .
pub fn read(&self, addr: u64, data: &mut [u8]) -> Result<()> {
        if let Some((base, offset, dev)) = self.resolve(addr) {
            // OK to unwrap as lock() failing is a serious error condition and should panic.
            dev.lock()
                .expect("Failed to acquire device lock")
                .read(base, offset, data);
            Ok(())
        } else {
            Err(Error::MissingAddressRange)
        }
    }
pub fn read ( & self , addr : u64 , data : & mut [ u8 ] ) -> Result < ( ) > { if let Some ( ( base , offset , dev ) ) = self . resolve ( addr ) { // OK to unwrap as lock() failing is a serious error condition and should panic. dev . lock ( ) . expect ( " " ) . read ( base , offset , data ) ; Ok ( ( ) ) } else { Err ( Error :: MissingAddressRange ) } }
Reads data from the device that owns the range containing `addr` and puts it into `data`.
Reads data from the device that owns the range containing ` addr ` and puts it into ` data ` .
&self
addr
u64
data
&mut [u8]
&self
addr
u64
data
&mut [u8]