pub async fn expect_read(mut self, blob: &[u8]) {
        self.send_on_open_with_readable(Status::OK);

        let mut rest = blob;
        while !rest.is_empty() {
            let count = self.handle_read(rest).await;
            rest = &rest[count..];
        }

        // Handle one extra request with empty buffer to signal EOF.
        self.handle_read(rest).await;

        match self.stream.next().await {
            None => {}
            Some(Ok(FileRequest::Close { responder })) => {
                let _ = responder.send(Status::OK.into_raw());
            }
            Some(other) => panic!("unexpected request: {:?}", other),
        }
    }
/// Succeeds the open request, then handle read request with the given blob data.
///
/// # Panics
///
/// Panics on error
Succeeds the open request, then handle read request with the given blob data.
Succeeds the open request then handle read request with the given blob data .
pub async fn expect_read(mut self, blob: &[u8]) {
        self.send_on_open_with_readable(Status::OK);
        let mut rest = blob;
        while !rest.is_empty() {
            let count = self.handle_read(rest).await;
            rest = &rest[count..];
        }
        // Handle one extra request with empty buffer to signal EOF.
        self.handle_read(rest).await;
        match self.stream.next().await {
            None => {}
            Some(Ok(FileRequest::Close { responder })) => {
                let _ = responder.send(Status::OK.into_raw());
            }
            Some(other) => panic!("unexpected request: {:?}", other),
        }
    }
pub async fn expect_read ( mut self , blob : & [ u8 ] ) { self . send_on_open_with_readable ( Status :: OK ) ; let mut rest = blob ; while ! rest . is_empty ( ) { let count = self . handle_read ( rest ) . await ; rest = & rest [ count .. ] ; } // Handle one extra request with empty buffer to signal EOF. self . handle_read ( rest ) . await ; match self . stream . next ( ) . await { None => { } Some ( Ok ( FileRequest :: Close { responder } ) ) => { let _ = responder . send ( Status :: OK . into_raw ( ) ) ; } Some ( other ) => panic ! ( " " other ) , } }
Succeeds the open request, then handle read request with the given blob data.
Succeeds the open request then handle read request with the given blob data .
mut self
blob
&[u8]
mut self
blob
&[u8]
panics
Panics on error
Panics on error