async fn read_at(&mut self, offset: u64, buf: &mut [u8]) -> LxResult<usize> {
        if !self.flags.readable() {
            return Err(LxError::EBADF);
        }
        if !self.flags.non_block() {
            // block
            loop {
                match self.inode.read_at(offset as usize, buf) {
                    Ok(read_len) => return Ok(read_len),
                    Err(FsError::Again) => {
                        self.inode.async_poll().await?;
                    }
                    Err(err) => return Err(err.into()),
                }
            }
        }
        let len = self.inode.read_at(offset as usize, buf)?;
        Ok(len)
    }
/// read from file at given offset
read from file at given offset
read from file at given offset
async fn read_at(&mut self, offset: u64, buf: &mut [u8]) -> LxResult<usize> {
        if !self.flags.readable() {
            return Err(LxError::EBADF);
        }
        if !self.flags.non_block() {
            // block
            loop {
                match self.inode.read_at(offset as usize, buf) {
                    Ok(read_len) => return Ok(read_len),
                    Err(FsError::Again) => {
                        self.inode.async_poll().await?;
                    }
                    Err(err) => return Err(err.into()),
                }
            }
        }
        let len = self.inode.read_at(offset as usize, buf)?;
        Ok(len)
    }
async fn read_at ( & mut self , offset : u64 , buf : & mut [ u8 ] ) -> LxResult < usize > { if ! self . flags . readable ( ) { return Err ( LxError :: EBADF ) ; } if ! self . flags . non_block ( ) { // block loop { match self . inode . read_at ( offset as usize , buf ) { Ok ( read_len ) => return Ok ( read_len ) , Err ( FsError :: Again ) => { self . inode . async_poll ( ) . await ? ; } Err ( err ) => return Err ( err . into ( ) ) , } } } let len = self . inode . read_at ( offset as usize , buf ) ? ; Ok ( len ) }
read from file at given offset
read from file at given offset
&mut self
offset
u64
buf
&mut [u8]
&mut self
offset
u64
buf
&mut [u8]