async fn read(
        &mut self,
        offset: u64,
        length: u64,
        ) -> Result<Vec<u8>, Self::Error>
    {
        let this = Arc::clone(&self.0);
        let (tx, rx) = async_channel::bounded(1);

        spawn_local(async move {
            let ram = this.lock().await;
            let result = ram.read_js(offset, length).await
                .map(|js| Uint8Array::new(&js).to_vec())
                .map_err(|_| anyhow!("Error calling read_js.").into());
            tx.send(result).await.unwrap();
        });

        rx.recv().await?
    }
/// Read a sequence of bytes at an offset from the backend.
Read a sequence of bytes at an offset from the backend.
Read a sequence of bytes at an offset from the backend .
async fn read(
        &mut self,
        offset: u64,
        length: u64,
        ) -> Result<Vec<u8>, Self::Error>
    {
        let this = Arc::clone(&self.0);
        let (tx, rx) = async_channel::bounded(1);
        spawn_local(async move {
            let ram = this.lock().await;
            let result = ram.read_js(offset, length).await
                .map(|js| Uint8Array::new(&js).to_vec())
                .map_err(|_| anyhow!("Error calling read_js.").into());
            tx.send(result).await.unwrap();
        });
        rx.recv().await?
    }
async fn read ( & mut self , offset : u64 , length : u64 , ) -> Result < Vec < u8 > , Self :: Error > { let this = Arc :: clone ( & self . 0 ) ; let ( tx , rx ) = async_channel :: bounded ( 1 ) ; spawn_local ( async move { let ram = this . lock ( ) . await ; let result = ram . read_js ( offset , length ) . await . map ( | js | Uint8Array :: new ( & js ) . to_vec ( ) ) . map_err ( | _ | anyhow ! ( " " ) . into ( ) ) ; tx . send ( result ) . await . unwrap ( ) ; } ) ; rx . recv ( ) . await ? }
Read a sequence of bytes at an offset from the backend.
Read a sequence of bytes at an offset from the backend .
&mut self
offset
u64
length
u64
&mut self
offset
u64
length
u64