pub async fn handle_read_at_until_close(mut self, data: &[u8]) {
        loop {
            match self.stream.next().await {
                Some(Ok(FileRequest::ReadAt { count, offset, responder })) => {
                    let offset: usize = offset.try_into().unwrap();
                    let count = min(count.try_into().unwrap(), data.len() - offset);
                    responder.send(Status::OK.into_raw(), &data[offset..offset + count]).unwrap();
                }
                Some(Ok(FileRequest::Close { responder })) => {
                    let _ = responder.send(Status::OK.into_raw());
                    return;
                }
                None => {
                    return;
                }
                other => panic!("unexpected request: {:?}", other),
            }
        }
    }
/// Handle all read_at requests with the given blob data until close is called.
///
/// # Panics
///
/// Panics on error
Handle all read_at requests with the given blob data until close is called.
Handle all read_at requests with the given blob data until close is called .
pub async fn handle_read_at_until_close(mut self, data: &[u8]) {
        loop {
            match self.stream.next().await {
                Some(Ok(FileRequest::ReadAt { count, offset, responder })) => {
                    let offset: usize = offset.try_into().unwrap();
                    let count = min(count.try_into().unwrap(), data.len() - offset);
                    responder.send(Status::OK.into_raw(), &data[offset..offset + count]).unwrap();
                }
                Some(Ok(FileRequest::Close { responder })) => {
                    let _ = responder.send(Status::OK.into_raw());
                    return;
                }
                None => {
                    return;
                }
                other => panic!("unexpected request: {:?}", other),
            }
        }
    }
pub async fn handle_read_at_until_close ( mut self , data : & [ u8 ] ) { loop { match self . stream . next ( ) . await { Some ( Ok ( FileRequest :: ReadAt { count , offset , responder } ) ) => { let offset : usize = offset . try_into ( ) . unwrap ( ) ; let count = min ( count . try_into ( ) . unwrap ( ) , data . len ( ) - offset ) ; responder . send ( Status :: OK . into_raw ( ) , & data [ offset .. offset + count ] ) . unwrap ( ) ; } Some ( Ok ( FileRequest :: Close { responder } ) ) => { let _ = responder . send ( Status :: OK . into_raw ( ) ) ; return ; } None => { return ; } other => panic ! ( " " other ) , } } }
Handle all read_at requests with the given blob data until close is called.
Handle all read_at requests with the given blob data until close is called .
mut self
data
&[u8]
mut self
data
&[u8]
panics
Panics on error
Panics on error